annotate lisp/vc-cvs.el @ 107863:594e81986a75

2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-insert-link): Find the link buffer on visible frames. (org-export-latex-default-packages-alist): hyperref must be loaded late. (org-open-file): More care with the new matching for file links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Do not yet protect defined entities - these will be taken care of later. (org-export-latex-special-chars): Post-process entity replacement. (org-export-latex-fontify-headline): Do not yet protect defined entities - these will be taken care of later. (org-export-latex-tables, org-export-latex-links): Format the caption properly. * org-entities.el (org-entities-user): Fix typo. * org.el (org-prepare-agenda-buffers): Uniquify TODO keywords * org-entities.el (org-entities-user): Improve docstring. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-entities.el (org-macs): Require org-macs, to be sure that we have `declare-function' defined. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Update docstring. * org.el (org-format-latex-header): Add cookies to the header. (org-splice-latex-header): Implement placement according to cookies. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-aux-preprocess): Control case sensitivity. 2010-04-10 Bastien Guerry <bzg@altern.org> * org.el (org-splice-latex-header): Fix typo. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Use `org-splice-latex-header' to build the header. (org-export-latex-classes): Update docstring. * org.el (org-splice-latex-header): New function. (org-create-formula-image): Use `org-splice-latex-header' to build the header. * org-gnus.el (org-gnus-follow-link): Handle nndoc backend. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-export-latex-packages-alist) (org-export-latex-default-packages-alist): Fix docstring to reflect the expected structure. * org-docbook.el (org-docbook-do-expand): Fix bug with variable names. (org-export-docbook-finalize-table): Make use of label for tables. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-attach.el (org-attach-commit): Split on newlines. * org.el (org-export-latex-default-packages-alist): Use list instead of cons for the entries. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-entities.el (org-entity-get-representation): Catch the case that there is not entry in the list. * org-mobile.el (org-mobile-use-encryption) (org-mobile-encryption-tempfile, org-mobile-encryption-password): New options. (org-mobile-check-setup): CHeck the encryption setup. (org-mobile-copy-agenda-files, org-mobile-sumo-agenda-command) (org-mobile-create-sumo-agenda): Use encryption code. (org-mobile-encrypt-and-move): New function. (org-mobile-encrypt-file, org-mobile-decrypt-file): New functions. (org-mobile-move-capture): Decrypt the capture file. * org.el (org-entities): Require the new file. (org-export-latex-default-packages-alist): New variable. (org-complete): Use new entity code for completion. (org-create-formula-image): Use the new packages variable. * org-latex.el (org-export-latex-classes): Remove the standard packages from the class headers. (org-export-latex-make-header): Use the new package variable. (org-export-latex-special-chars): Better regexp for entities, to support entity name that contain numbers. (org-export-latex-treat-backslash-char): Use the new entity code. * org-html.el (org-html-do-expand): Use the new entity code. * org-exp.el (org-export): Add the new export commands. (org-html-entities): Constant removed. (org-export-visible): Add the new export commands. * org-entities.el: New file. * org-docbook.el (org-docbook-do-expand): Use new entity code. * org-ascii.el (org-export-ascii-entities): New variable. (org-export-as-latin1, org-export-as-latin1-to-buffer) (org-export-as-utf8, org-export-as-utf8-to-buffer): New commands. (org-export-as-encoding): New function. (org-export-ascii-preprocess): Call `org-ascii-replace-entities'. (org-ascii-replace-entities): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-html-level-start): Catch the case that target might be nil. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org.el (org-appearance): Change Customize group variable name from org-font-lock to org-appearance, and change tag from "Org Font Lock" to "Org Appearance" (org-odd-levels-only): Change Customize group variable name (org-level-color-stars-only): Change Customize group variable name (org-hide-leading-stars): Change Customize group variable name (org-hidden-keywords): Change Customize group variable name (org-fontify-done-headline): Change Customize group variable name (org-fontify-emphasized-text): Change Customize group variable name (org-fontify-whole-heading-line): Change Customize group variable name (org-highlight-latex-fragments-and-specials): Change Customize group variable name (org-hide-emphasis-markers): Change Customize group variable name (org-emphasis-alist): Change Customize group variable name (org-emphasis-regexp-components): Change Customize group variable name (org-modules): Remove mention of org-R * org-faces.el (org-faces): Change Customize group variable name 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-last-run-time): New variable. (org-diary): prepare agenda buffers only if last call was some time ago. * org-html.el (org-export-html-preprocess): Replace \ref macros with a link. (org-format-org-table-html): Add the label as an anchor. * org-docbook.el (org-export-docbook-format-image): Do some formatting on captions. * org-latex.el (org-export-latex-tables, org-export-latex-links): Do some formatting on captions. * org-html.el (org-export-html-format-image) (org-format-org-table-html): Do some formatting on captions. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org.el (org-hidden-keywords): New customizable variable. This is a list of symbols specifying which of the special keywords #+DATE, #+AUTHOR, #+EMAIL and #+TITLE should be hidden by font lock. (org-fontify-meta-lines-and-blocks): Changes to font-lock code implementing new faces and hiding behaviour. * org-faces.el (org-document-title): New face for #+TITLE lines (org-document-info): New face for #+DATE, #+AUTHOR, #+EMAIL lines (org-document-info-keyword): New face for #+DATE, #+AUTHOR, #+EMAIL keywords 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-sanitize-plist): New function to rename "index" properties to "sitemap". Do this renaming globally. (org-publish-with-aux-preprocess-maybe): New macro. (org-publish-org-to-pdf, org-publish-org-to-html): Use the new macro. (org-publish-aux-preprocess) (org-publish-index-generate-theindex.inc): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-align): Interpret <N> at fixed width, not as maximum width. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-author-info, org-export-email-info): Fix docstrings. * org-beamer.el (org-beamer-select-environment): Renamed from `org-beamer-set-environment-tag'. Improve docstring. * org-freemind.el (org-freemind-write-mm-buffer): Fix another problem with odd levels. * org-ascii.el (org-export-as-ascii): Export email only if the author wants it. * org-docbook.el (org-export-as-docbook): Export email only if the author wants it. * org-html.el (org-export-as-html): Export email only if the author wants it. * org-exp.el (org-export-email-info): New option. (org-export-plist-vars): Add entry for `org-export-email'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-goto-line): Fix typo. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-agenda-files): Typo. (org-read-agenda-file-list): Add optional argument to help `org-store-new-agenda-file-list' to remember un-expanded file names. Expand file names relative to `org-directory'. (org-store-new-agenda-file-list): Keep un-expanded file names when saving, if available. (org-agenda-files): Update documentation. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-ascii.el (org-export-as-ascii): Catch the case of exporting a buffer with no file name attached. * org.el (org-log-refile): New option. (org-log-note-headings): Add a heading for refiling. (org-startup-options): Add keywords for logging of the refile action. (org-refile): Add logging action. (org-add-log-note): Allow for refiling action. * org-agenda.el (org-agenda-bulk-action): Make sure `org-log-refile' is not `note' during a bulk action. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-map-dblocks): Use save-excursion to remember the position. * org-attach.el (org-attach-commit): Remove dependence on xargs. (org-attach-delete-one): Commit after deleting a file. * org-latex.el (org-export-latex-fontify): Do not mistake table.el borders for strike-through emphasis. * org-freemind.el (org-freemind-write-mm-buffer): Simplify the handling of odd levels. * org-agenda.el (org-agenda-todo-ignore-deadlines): Document `past' and `future' values. (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): Handle `past' and `future' values. * org.el (org-read-agenda-file-list): Interpret file names relative to org-directory and allow environment variables and "~". * org-latex.el (org-export-latex-special-chars): Allow a parenthesis before an exponent or subscript. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-exit): When returning from code edit buffer, if code block is hidden, leave point at start of #+begin_src line 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-insert-heading): Do not remove all spaces if the headline is empty. * org-indent.el (org-indent): Fix group name. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-goto-column): Fix forcing a non-existing column. (org-table-get, org-table-put, org-table-goto-line) (org-table-current-line): New functions. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org.el (org-open-file): Allow regular expressions in org-file-apps to capture link parameters using groups. In a command string to be executed, the parameters can be referenced using %1, %2, etc. Lisp forms can access them using (match-string n link). (org-apps-regexp-alist): Adopt the created regexp, as this is now matched against a file: link instead of the file name. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-crypt.el (org-reveal-start-hook): Add a decryption function to this hook. (org-decrypt-entries, org-encrypt-entries, org-decrypt-entry): Add docstrings. * org.el (org-point-at-end-of-empty-headline) (org-level-increment, org-get-previous-line-level): New function. (org-cycle-level): Rewritten to be independent of when this function is called. (org-in-regexps-block-p): New function. (org-reveal-start-hook): New hook. (org-reveal): Run new hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-keywords): Start a new paragraph after time keywords, do not add "\newline". * org-html.el (org-export-as-html): Avoid double # in href. * org.el (org-refile-get-location): Catch an invalid target specification. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Make sure the behavior regarding to extracting time is consistent. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-agenda-insert-diary-extract-time): New variable. (org-agenda-add-entry-to-org-agenda-diary-file): Use this new variable rather than `org-agenda-search-headline-for-time'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-fix-bullet-type): Improve cursor positioning. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-adaptive-fill-regexp-backup): New variable. (org-set-autofill-regexps): Store a backup of `adaptive-fill-regexp'. (org-adaptive-fill-function): Fix filling of comments and ordered lists. If there is no other match, till try adaptive fill. 2010-04-10 John Wiegley <jwiegley@gmail.com> * org-agenda.el (org-agenda-include-deadlines): Added new customization variable to determine whether unscheduled tasks should appear in the agenda solely because of their deadline. Default to true, which was the previous behavior (it just wasn't configurable). (org-agenda-mode-map, org-agenda-view-mode-dispatch): Bind ! in the agenda to show/hide deadline tasks. (org-agenda-menu): Added menu option for show/hide deadlines. (org-agenda-list): Make the agenda list sensitive to the value of `org-agenda-include-deadlines'. (org-agenda-toggle-deadlines): New function to toggle the value of `org-agenda-include-deadlines' and repaint the modeline indicators. (org-agenda-set-mode-name): Show "Deadlines" in the agenda modeline if deadline tasks are being displayed. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-eval-formula): Replace $# and @# by current column and row number. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-set-property, org-delete-property): Go back to prompting for the property. * org-latex.el (org-export-latex-make-header): Fully process author line. (org-export-latex-fontify-headline): Allow several arguments, not just one. (org-export-latex-fix-inputenc): Catch the error when `latexenc-coding-system-to-inputenc' is not defined. * org-agenda.el (org-agenda-skip-if-todo): New function. (org-agenda-skip-if): Add conditions for TODO keywords. (org-agenda-skip-if): Document the new todo conditions. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-at-property-p): Check if we are inside a property drawer not just any drawer. (org-set-property, org-delete-property): When cursor is on a property key value pair do not prompt for property name instead use name at cursor. (org-ctrl-c-ctrl-c): Still do org-property-action when cursor is on the first line of a property drawer. (org-property-end-re): Spell check. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-attach-captions-and-attributes): Add the properties to the entire table, in case the first line is removed. * org-archive.el (org-archive-reversed-order): New option. (org-archive-subtree, org-archive-to-archive-sibling): Use the new option `org-archive-reversed-order'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-entry-types): New variable. (org-agenda-list): Use `org-agenda-entry-types'. (org-agenda-custom-commands-local-options): Support for setting `org-agenda-entry-types' as an option. (org-diary): Shift some documentation from here to the variable `org-agenda-entry-types'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Apply macros in author field. * org-clock.el (org-clocking-buffer, org-clocking-p): New function. (org-clock-select-task, org-clock-notify-once-if-expired) (org-clock-in, org-clock-out, org-clock-cancel, org-clock-goto) (org-clock-out-if-current, org-clock-save): Use the new functions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-docbook.el (org-export-as-docbook): Remove unnecessary newline. (org-export-as-docbook): Remove unnecessary newline. (org-export-as-docbook): Fix problem with double footnote reference in one place. * org-exp.el (org-export-format-source-code-or-example): Remove unnecessary newline. * org.el (org-deadline, org-schedule): Allow rescheduling entries with repeaters. * org-table.el (org-table-convert-refs-to-rc): Better way to catch function calls that look like references. * org.el (org-open-at-point): Get link abbreviations from reference buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-convert-refs-to-rc): Do not read arctan2 as a reference. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-link-unescape): Solve issue with lower-case escapes. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Add \usepackage{latexsym} to all classes. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html): Do not allow protected lines into the table of contents. * org-latex.el (org-export-latex-special-chars): Find subsequent occurrences of special characters. (org-export-latex-tables): Do not convert table-like stuff that is protected. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-toggle-checkbox): No errors when updating checkbox count fails because there is no heading. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-report-include-clocking-task): New option. (org-clock-sum): Add the current clocking task. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-cycle): Print a message when in a table.el table. (org-edit-special): Recognize the table.el context. (org-ctrl-c-ctrl-c): Print a message when in a table.el table. * org-src.el (org-at-table.el-p): Declare. (org-edit-src-code): Handle a special case for table.el editing. (org-edit-src-find-region-and-lang): Recognize the table.el context. * org-latex.el (org-export-latex-tables): Convert table.el tables. (org-export-latex-convert-table.el-table): New function. * org-html.el (org-html-expand): Fix table.el export. * org-latex.el (org-export-latex-preprocess): Protect footnotes in headings. * org-id.el (org-id-find-id-file): Fix bug when there is no hash table for the id locations. * org.el (org-read-date-analyze): Match American-style dates, like 5/30 or 5/13/7. Make sure cal-iso.el is loaded. Don't force he current year when reading ISO and American dates. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-face-from-face-or-color): New function. (org-get-todo-face, org-font-lock-add-priority-faces) (org-get-tag-face): Use `org-face-from-face-or-color'. * org-faces.el (org-todo-keyword-faces, org-priority-faces): Allow simple colors as values. (org-faces-easy-properties): New option. * org-agenda.el (org-agenda-set-mode-name): Show if the agenda is restricted, as an agenda mode. (org-agenda-fontify-priorities): Allow simple colors as values. 2010-04-10 Bastien Guerry <bzg@altern.org> * org-timer.el (org-timer-current-timer): Renamed from `org-timer-last-timer'. (org-timer-timer1, org-timer-timer2, org-timer-timer3): Removed. (org-timer-cancel-timer, org-timer-show-remaining-time) (org-timer-set-timer): Update to use only one timer. * org.el (org-set-property): Remove useless space in the prompt. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-html-style-default): Add a default style for textareas. * org-exp.el (org-export-format-source-code-or-example): Fix textarea tag. 2010-04-10 Bastien Guerry <bzg@altern.org> * org-clock.el (org-clock-current-task): New variable to store last clocked in task. (org-clock-set-current, org-clock-delete-current): New functions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): Extend comment. (org-remember-handler): Implement clock sibling filing. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-all, org-publish-current-file) (org-publish-current-project): When called with prefix argument FORCE, also rebuild the validation file list. * org-latex.el (org-export-latex-preprocess): Protect footnotes in section headings. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html-and-open): Kill product buffer if the user wants that. * org-latex.el (org-export-as-pdf-and-open): Kill product buffer if the user wants that. * org-exp.el (org-export-kill-product-buffer-when-displayed): New option. * org-agenda.el (org-batch-agenda-csv): Use the time property instead of the `time-of-day' property. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-timer.el (org-timer-start-hook, org-timer-stop-hook) (org-timer-pause-hook, org-timer-set-hook) (org-timer-cancel-hook): New hooks. (org-timer-start): Run `org-timer-start-hook'. (org-timer-pause-or-continue): Run `org-timer-pause-hook'. (org-timer-stop): Run `org-timer-stop-hook'. (org-timer-cancel-timers): Run `org-timer-cancel-hook'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-reveal): Double prefix arg shows the subtree of the parent. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-search-view): Fix bug with searching full words in headlines in search view. (org-agenda-skip-deadline-prewarning-if-scheduled): New option. (org-agenda-get-deadlines): Suppress pre-warning if the entry is scheduled (if the user configures it so. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-hide-archived-subtrees): Don't jump to end of subtree if the match was not in a headline. (org-inside-latex-macro-p): Allow more complex arguments. (org-emphasize): Protect against use at end of buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-align-tags): Avoid side effects on text properties. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-todo-ignore-scheduled): More allowed values. (org-agenda-todo-ignore-scheduled) (org-agenda-todo-ignore-deadlines): More control with different allowed values. (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): Honor the new option settings. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-get-location): Make sure the selection buffer is shown in the current frame. * org-ascii.el (org-export-ascii-table-widen-columns): New option. (org-export-ascii-preprocess): Realign tables to remove narrowing if `org-export-ascii-table-widen-columns' is set. * org-table.el (org-table-do-narrow): New variable. (org-table-align): Narrow only if `org-table-do-narrow' is t. * org.el (org-deadline, org-schedule): Allow updating if the relevant time stamp does not have a repeater, i.e. do not require that no time stamp has a repeater. * org-agenda.el (org-agenda-align-tags): Don't add a face to the new white space before the tags. * org-latex.el (org-export-as-latex): Do nit require the buffer to be visiting a file when only exporting to a buffer or string. (org-export-latex-fix-inputenc): Only save the buffer is there is a file name attached to it. 2010-04-10 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-exit): Widen before exiting edit buffers 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-fontify-meta-lines-and-blocks): Honor `org-fontify-quote-and-verse-blocks'. * org-faces.el (org-fontify-quote-and-verse-blocks): New option. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-at-point): Also check for text property org-linked-text before offering collected links. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Optionally extract time specification from text and add to the timestamp. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Fix typo. * org-latex.el (org-export-latex-make-header): Use \providecommand to make sure the \alert macro is defined. * org.el (org-format-latex-signal-error) (org-create-formula-image): Use `org-format-latex-signal-error'. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org.el (org-store-link): For dired buffers, use default-directory as link name if dired-get-filename returns nil. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-concatenate-multiline-links): The for protectedness at beginning of match. * org-latex.el (org-export-latex-fix-inputenc): Never leave the AUTO as a coding system, instead default to utf8. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-block-todo-from-children-or-siblings-or-parent) (org-block-todo-from-checkboxes): Respect the local variable value when deciding if blocking should be active. * org-latex.el (org-export-latex-make-header): Define the align macro if it is not yet defined. * org-agenda.el (org-agenda-insert-diary-make-new-entry): Call `org-insert-heading' with the INVISIBLE-OK argument. * org-mac-message.el (org-mac-message-insert-flagged): Call `org-insert-heading' with the INVISIBLE-OK argument. * org.el (org-insert-heading): New argument INVISIBLE-OK. * org-agenda.el (org-agenda-view-mode-dispatch): Improve the prompt message. * org-html.el (org-html-level-start): Use the `html-container-class' text property to set an additional class for an outline container. * org-exp.el (org-export-remember-html-container-classes): New function. (org-export-preprocess-string): Call `org-export-remember-html-container-classes'. * org.el (org-cycle): Mention level cycling in the docstring. (org-default-properties): Add new property HTML_CONTAINER_CLASS. * org-remember.el (org-remember-apply-template): Do file insertion first. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-habit.el (org-habit-insert-consistency-graphs): Fix a problem with mis-aligned graphs when showing habits. 2010-04-10 Mikael Fornius <mfo@abc.se> * org.el (org-assign-fast-keys): Prefer keys used in keyword name when assigning. Begin using numerical characters when all in name is used up. This is to spare alphanumeric characters for better match with other keywords. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-preprocess-hook): Improve documentation. * org-latex.el (org-export-latex-preprocess): More consistent conversion and protection of the words LaTeX and TeX. (org-export-latex-fontify-headline, org-export-latex-preprocess): Allow angle brackets in commands, for beamer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-in): Improve the look of the clock line by formatting links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-classes): Use AUTO as the place holder string for the coding system. And improve the documentation. (org-export-latex-fix-inputenc): Only modify the coding system if it is given by the placeholder AUTO. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-task-overrun-text): New option. (org-task-overrun, org-clock-update-period): New variables. (org-clock-get-clock-string, org-clock-update-mode-line): Mark overrun clock. (org-clock-notify-once-if-expired): Check if clock is overrun. * org-faces.el: New face `org-mode-line-clock-overrun'. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org.el (org-narrow-to-subtree): Position the end of the narrowed region before the line with the next heading, to prevent the user from prepending text to the next headline. 2010-04-10 Stephen Eglen <stephen@gnu.org> * org-agenda.el (org-get-time-of-day): Use org-agenda-time-leading-zero to allow leading zero (rather than space) for times. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure org-datetree.el is loaded. * org-datetree.el: autoload `org-datetree-find-day-create' * org-latex.el (org-export-latex-hyperref-format): New option. (org-export-latex-links): Use `org-export-latex-hyperref-format'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-ctags.el (org-ctags-enable): Change order of functions. (org-ctags-create-tags): Add wildcard to file name expansion. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-entry-properties): Fix some important bugs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-link-unescape, org-link-escape): Only use hexlify if the table is not explicitly given. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-out-when-done): Allow a list of keywords as value. (org-clock-out-if-current): Work with the new list value of `org-clock-out-when-done'. (org-clock-out, org-clock-out-if-current): Avoid circular logic between clocking out and state changes. * org-ctags.el (org-ctags-path-to-ctags): Better system-type test. * org-latex.el (org-export-latex-treat-backslash-char): Do not by accident protect a character that is before a backslash. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-class): Use `org-order-calendar-date-args'. * org.el (org-order-calendar-date-args): New function. * org-exp.el (org-export-target-internal-links): Check for protectedness after the first bracket. * org.el (org-entry-properties): Don't match wrong-case TODO keywords. * org-agenda.el (org-agenda-schedule, org-agenda-deadline): Document that ARG is passed through to remove the date. (org-agenda-bulk-action): Accept prefix arg and pass it on. Do not read a date when the user has given a `C-u' prefix. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-fix-displayed-tags): Fix bug when all tags are hidden. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-fix-inputenc): New function. (org-export-latex-inputenc-alist): New option. * org-exp.el (org-export): New key SPC to publish enclosing subtree. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-indent.el (org-indent-add-properties): Catch case when there is no headline in the buffer. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Add checkmark symbol. * org-ascii.el (org-export-ascii-preprocess): Protect targets in verbatim code for ASCII export. * org.el (org-update-statistics-cookies): Also see checkboxes in ordered lists. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-view-mode-dispatch): Define the `L' key. * org-beamer.el (org-beamer-amend-header): Change the location where `org-beamer-header-extra' is inserted. * org.el (org-compute-latex-and-specials-regexp): Don't do BIND just for computing this regexp. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-frame-default-options): New option. (org-beamer-sectioning): Use default options if the user does not have defined any. (org-beamer-fix-toc): Put a frame around the table of contents. * org-exp.el (org-export-remove-comment-blocks-and-subtrees): Make sure case-folding works well when processing comment stuff. * org-latex.el (org-export-latex-after-save-hook): New hook. (org-export-as-latex): Run the new hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-environments-default): Add the note environments. (org-beamer-after-initial-vars): Allow several BEAMER_HEADER_EXTRA lines and collect and combine the content. (org-beamer-after-initial-vars): Check for note tags and make sure they will be seen like a property. * org.el (org-offer-links-in-entry): Fix bug when there is a single link. * org-exp.el (org-export): Make sure the mark is activated, also when `transient-mark-mode' is off. * org-agenda.el (org-agenda-search-view-always-boolean): New option. (org-agenda-search-view-search-words-only): Obsolete variable, is now an alias for `org-agenda-search-view-always-boolean'. (org-agenda-search-view-force-full-words): New option. (org-search-view): Improve docstring, and implement a better logic for Boolean and phrase searches. (org-agenda-last-search-view-search-was-boolean): New variable. (org-agenda-manipulate-query): Consider the type of the last search when modifying the search string. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-as-latex): Do the first letbind in the right moment. * org-agenda.el (org-get-entries-from-diary): Add the new face to these entries. * org-faces.el (org-agenda-diary): New face. * org.el (org-make-link-regexps): Allow regexp-special characters in link types. (org-open-file): When in-emacs is `system', also force system opening, like when the value was `(16)'. (org-update-statistics-cookies): Handle entries without children. * org-exp.el (org-export-preprocess-before-normalizing-links-hook): New hook. (org-export-preprocess-string): Run the new hook. * org.el (org-offer-links-in-entry): Make RET open all links. * org-html.el (org-export-as-html): Remove any leftover display properties in the html file. * org-wl.el (org-wl-store-link): Work-around for format bug with text properties. * org-habit.el (org-habit-insert-consistency-graphs): Turn off invisibility while adding the graphs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-select-remember-template): Use C letter to customize remember templates. * org-agenda.el (org-agenda-bulk-mark, org-agenda-bulk-unmark): Move cursor to next visible line. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-sectioning): Leave columns environment by specifying 0 or 1 for column width. (org-beamer-column-widths): Make 0 stand for 0.0. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-mark-radio-links): Don't match inside <<target>>. * org.el (org-format-latex-header-extra): New variable. (org-format-latex): Set org-format-latex-header-extra from in-buffer stuff. (org-format-latex): Add org-format-latex-header-extra to the variables on which image creation depends. (org-create-formula-image): Add the header stuff from in-buffer settings. (org-read-date-analyze): Base the analysis for future preference on NOW, not on the default date. * org-inlinetask.el (org-inlinetask-export-handler): Add CSS class for TODO keyword in inline tasks. * org.el (org-log-note-headings): New headings for removing deadline or scheduling date. (org-deadline, org-schedule): Arrange for logging when removing a date. (org-add-log-note): Handle deadline and scheduling removal. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-visible): Add LaTeX/pdf export. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-diary-class): New function. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Do process the text of a radio target. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-entry-properties): Add TIMESTAMP properties back in. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-all-time-keywords): New variable. (org-set-regexps-and-options): Set `org-all-time-keywords'. (org-entry-blocked-p): New function. (org-special-properties): Add BLOCKED as a new special property. (org-entry-properties): New optional argument SPECIFIC, only parse for this property when it is specified. (org-entry-get): Pass a SPECIFIC argument to `org-entry-properties'. * org-latex.el (org-export-as-latex): Preprocess TEXT as well. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-tables): No forced line end if there is no caption. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-html-entities): Add Euro symbols from Marvosym package. * org-latex.el (org-export-latex-tables): Only add a caption when macro in in longtable environments if one has been defined. * org-html.el (org-export-as-html): Only take title from buffer if not exporting body-only. * org-latex.el (org-export-latex-preprocess): Better version of the regular expression for protecting LaTeX macros. (org-export-latex-preprocess): Start searching for macros to protect from beginning of buffer. * org-exp.el (org-export-target-internal-links): Check for protectedness earlier in the string. * org-agenda.el (org-agenda-highlight-todo): Match TODO keywords case sensitively. * org-id.el (org-id-store-link): Match TODO keywords case sensitively. * org.el (org-heading-components, org-get-outline-path) (org-display-outline-path): Match TODO keywords case sensitively. * org-latex.el (org-export-as-latex): Ignore read-only properties. * org-exp.el (org-export-preprocess-string): Remove any `read-only' properties. * org-agenda.el (org-agenda-inactive-leader): New option. (org-agenda-get-timestamps): Use `org-agenda-inactive-leader'. (org-tags-view): Prompt for matcher if MATCH is an empty string. (org-todo-list): Prompt for matcher if ARG is an empty string. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-link-functions): New hook. (org-open-at-point): Run `org-open-link-functions'. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-date-prompt): Allow inactive time stamps as well. * org.el (org-inhibit-startup-visibility-stuff): New variable. (org-mode): Don't do startup visibility if inhibited. (org-outline-overlay-data, org-set-outline-overlay-data): New functions. (org-save-outline-visibility): New macro. (org-log-note-headings): Document that one should not change the `state' note format. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-make-link-regexps): Capture link path into a group. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-beamer.el (org-beamer-after-initial-vars): Do not overwrite the options plist. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-startup-with-beamer-mode): New option. (org-property-changed-functions) (org-property-allowed-value-functions): New hooks. (org-entry-put, org-property-get-allowed-values): Run the new hooks. (org-property-next-allowed-value): Run the new hooks. * org-exp.el (org-export-select-backend-specific-text): Add the special beamer tags. * org-beamer.el (org-export-preprocess-before-selecting-backend-code-hook): New file. * org-latex.el (org-export-latex-after-initial-vars-hook): New hook. (org-export-as-latex): Run `org-export-latex-after-initial-vars-hook'. (org-export-latex-format-toc-function) (org-export-latex-make-header): Call `org-export-latex-format-toc-function'. * org.el (org-fill-template): Make template searches case sensitive. * org-exp.el (org-export): Use "1" as a sign to export only the subtree. * org-colview-xemacs.el (org-columns-edit-value): Use org-unrestricted property. * org-colview.el (org-columns-edit-value): Use org-unrestricted property. * org.el (org-compute-property-at-point): Set org-unrestricted text property if the list contains ":ETC". (org-insert-property-drawer): Use org-unrestricted property. * org-exp.el (org-export-preprocess-before-selecting-backend-code-hook): New hook. (org-export-preprocess-string): Run `org-export-preprocess-before-selecting-backend-code-hook'. * org-xoxo.el (org-export-as-xoxo): Run `org-export-first-hook'. * org-latex.el (org-export-region-as-latex): Run `org-export-first-hook'. * org-html.el (org-export-as-html): Run `org-export-first-hook'. * org-docbook.el (org-export-as-docbook): Run `org-export-first-hook'. * org-ascii.el (org-export-as-ascii): Run `org-export-first-hook'. * org-exp.el (org-export-first-hook): New hook. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-previous-item): Exit at the beginning of the buffer. * org-id.el (org-id-locations-save): Only write the id locations if any are defined. * org-archive.el (org-archive-all-done): Make this work in a file with org-odd-levels-only set. * org.el (org-get-refile-targets): Catch the case when a buffer has no file. * org-latex.el (org-export-as-latex): Cleanup forced line ends where they are not needed. (org-export-latex-subcontent): Remove unnecessary newlines. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-make-header): Remove \obeylines. (org-export-latex-fontify): Fix regexp bug that takes special care of protecting the right boundary characters in emphasis matches. (org-export-latex-preprocess): Allow multiple arguments to latex macros. * org.el (org-make-link-regexps): Use John Gruber's regexp for urls. * org-macs.el (org-re): Interpret :punct: in regexps. * org-exp.el (org-export-replace-src-segments-and-examples): Also take the final newline after the END line. * org.el (org-clean-visibility-after-subtree-move): Only fix entries that are not entirely invisible already. (org-insert-link): Respect org-link-file-path-type for "docview:" links in addition to "file:" links. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-format-source-code-or-example): Avoid additional extra white lines in LaTeX. * org-list.el (org-list-parse-list): Leave empty lines after the list, don't consider them as part of the list. * org-mobile.el (org-mobile-sumo-agenda-command): Allow tagstodo searches. * org-clock.el (org-clock-select-task): Convert integer to character for XEmacs. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-resolve): Make reading a char XEmacs compatible. 2010-04-10 Tassilo Horn <tassilo@member.fsf.org> * org.el (org-complete-tags-always-offer-all-agenda-tags): New variable. (org-set-tags): Use it. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-list.el (org-empty-line-terminates-plain-lists): Update docstring. * org.el (org-format-latex): Fix link creation for processed latex snippets. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-footnote.el (org-footnote-normalize): Protect replacement text. * org.el (org-inside-latex-macro-p): Save match data. 2010-04-10 Jan Bcker <jan.boecker@jboecker.de> * org-docview.el: New file. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-class-options): New variable. (org-export-latex-set-initial-vars): Use the class options. * org.el (org-forward-same-level): Stop at headings that start with an invisible character. (org-additional-option-like-keywords): Add LaTeX_CLASS_OPTIONS. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-footnote.el (org-footnote-normalize): Don't take optional arguments in LaTeX macros as footnotes. * org.el (org-inside-latex-macro-p): New function. * org-latex.el (org-latex-to-pdf-process): Change customization group to `org-export-pdf'. * org-agenda.el (org-agenda-get-blocks): Look at time string also on days after the first one. * org.el (org-insert-heading): Also check for item before assuming before-first-heading condition. * org-latex.el (org-latex-to-pdf-process): Fix typo in group tag. (org-export-pdf-logfiles): New option. (org-export-as-pdf): Use `org-export-pdf-logfiles'. (org-export-pdf-logfiles): Fix customization type. * org.el (org-insert-link): Improve error message when there is no default link to select with RET. * org-agenda.el (org-agenda-filter-by-tag): Use char argument from parameter list. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-parse-global) (org-export-latex-parse-content) (org-export-latex-parse-subcontent): Use `org-re-search-forward-unprotected'. (org-export-as-pdf): Remove log files produced by XeTeX. * org-macs.el (org-re-search-forward-unprotected): New function. 2010-04-10 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-agenda-colview-summarize): Sort out some confusion between properties and titles, which resulted in agenda summaries not working if a title was set for a column. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-agendas): New option. (org-mobile-sumo-agenda-command): Select the right agendas. * org-latex.el (org-export-latex-format-image): Preserve the original-indentation property. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-insert-selection-line): Catch error when an old tasks no longer exists. * org-latex.el (org-export-as-pdf): Remove also the .idx file. (org-export-as-pdf): Don't remove the old PDF file before making the new one. * org-mouse.el (org-mouse-end-headline, org-mouse-insert-item) (org-mouse-context-menu): Use `org-looking-back'. * org.el (org-cycle-level): Use `org-looking-back'. * org-list.el (org-cycle-item-indentation): Use `org-looking-back'. * org-compat.el (org-looking-back): New function. * org.el (org-insert-heading): Catch before-first-headline when inserting a headline. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-format-image): Indent figure environment, so that it does not interrupt plain list. * org.el (org-open-at-point): Allow long link descriptions. 2010-04-10 Carsten Dominik <carsten.dominik@gmail.com> * org-html.el (org-export-as-html): Remove empty lines at the beginning of the exported text. 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> * org.texi (LaTeX and PDF export): Add a footnote about xetex. (LaTeX/PDF export commands): Section renamed and moved. (Sectioning structure): Update. (References): New use case for field coordinates. (The export dispatcher): Renamed from ASCII export. (Setting up the staging area): Document the availability of encryption for MobileOrg. (Images and tables): Document how to reference labels. (Index entries): New section. (Generating an index): New section. (Column width and alignment): Document that <N> now means a fixed width, not a maximum width. (Publishing options): Document the :email option. (Beamer class export): Fix bug in the BEAMER example. (Refiling notes): Document refile logging. (In-buffer settings): Document refile logging keywords. (Drawers): Document `C-c C-z' command. (Agenda commands): Mention the alternative key `C-c C-z'. (Special properties): Document the BLOCKED property. (The spreadsheet): Mention the formula editor. (References): Document field coordinates. (Publishing action): Correct the documentation for the publishing function. (The date/time prompt): Document that we accept dates like month/day/year. (Cooperation): Document the changes in table.el support. (Faces for TODO keywords, Faces for TODO keywords) (Priorities): Document the easy colors. (Visibility cycling): Document the new double prefix arg for `org-reveal'. (Cooperation): Remember.el is part of Emacs. (Clean view): Mention that `wrap-prefix' is also set by org-indent-mode. (Agenda commands): Add information about prefix args to scheduling and deadline commands. (Search view): Point to the docstring of `org-search-view' for more details. (Agenda commands): Document that `>' prompts for a date. (Setting tags): Document variable org-complete-tags-always-offer-all-agenda-tags. (Column attributes): Cross-reference special properties.
author Carsten Dominik <carsten.dominik@gmail.com>
date Thu, 15 Apr 2010 12:11:52 +0200
parents 1918e70c8b37
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; vc-cvs.el --- non-resident support for CVS version-control
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
100186
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
3 ;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106472
diff changeset
4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; Author: FSF (see vc.el for full credits)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94563
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94563
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94563
diff changeset
14 ;; (at your option) any later version.
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94563
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24 ;;; Commentary:
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26 ;;; Code:
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
28 (eval-when-compile (require 'cl) (require 'vc))
35584
498bcc1e7c00 require vc
Sam Steingold <sds@gnu.org>
parents: 35569
diff changeset
29
81820
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
30 ;; Clear up the cache to force vc-call to check again and discover
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
31 ;; new functions when we reload this file.
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
32 (put 'CVS 'vc-functions nil)
35584
498bcc1e7c00 require vc
Sam Steingold <sds@gnu.org>
parents: 35569
diff changeset
33
94563
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
34 ;;; Properties of the backend.
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
35
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
36 (defun vc-cvs-revision-granularity () 'file)
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
37
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
38 (defun vc-cvs-checkout-model (files)
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
39 "CVS-specific version of `vc-checkout-model'."
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
40 (if (getenv "CVSREAD")
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
41 'announce
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
42 (let* ((file (if (consp files) (car files) files))
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
43 (attrib (file-attributes file)))
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
44 (or (vc-file-getprop file 'vc-checkout-model)
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
45 (vc-file-setprop
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
46 file 'vc-checkout-model
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
47 (if (and attrib ;; don't check further if FILE doesn't exist
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
48 ;; If the file is not writable (despite CVSREAD being
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
49 ;; undefined), this is probably because the file is being
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
50 ;; "watched" by other developers.
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
51 ;; (If vc-mistrust-permissions was t, we actually shouldn't
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
52 ;; trust this, but there is no other way to learn this from
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
53 ;; CVS at the moment (version 1.9).)
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
54 (string-match "r-..-..-." (nth 8 attrib)))
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
55 'announce
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
56 'implicit))))))
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
57
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
58 ;;;
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
59 ;;; Customization options
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
60 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
61
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
62 (defcustom vc-cvs-global-switches nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
63 "Global switches to pass to any CVS command."
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
64 :type '(choice (const :tag "None" nil)
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
65 (string :tag "Argument String")
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
66 (repeat :tag "Argument List"
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
67 :value ("")
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
68 string))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59443
diff changeset
69 :version "22.1"
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
70 :group 'vc)
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
71
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 (defcustom vc-cvs-register-switches nil
100202
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
73 "Switches for registering a file into CVS.
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 A string or list of strings passed to the checkin program by
100202
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
75 \\[vc-register]. If nil, use the value of `vc-register-switches'.
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
76 If t, use no switches."
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
77 :type '(choice (const :tag "Unspecified" nil)
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
78 (const :tag "None" t)
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 (string :tag "Argument String")
100202
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
80 (repeat :tag "Argument List" :value ("") string))
31475
b25e22223eb9 DOc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
81 :version "21.1"
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 :group 'vc)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83
35821
6b1ff979e045 (vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35702
diff changeset
84 (defcustom vc-cvs-diff-switches nil
100186
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
85 "String or list of strings specifying switches for CVS diff under VC.
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
86 If nil, use the value of `vc-diff-switches'. If t, use no switches."
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
87 :type '(choice (const :tag "Unspecified" nil)
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
88 (const :tag "None" t)
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
89 (string :tag "Argument String")
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
90 (repeat :tag "Argument List" :value ("") string))
35821
6b1ff979e045 (vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35702
diff changeset
91 :version "21.1"
6b1ff979e045 (vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35702
diff changeset
92 :group 'vc)
6b1ff979e045 (vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35702
diff changeset
93
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$"))
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
95 "Header keywords to be inserted by `vc-insert-headers'."
31475
b25e22223eb9 DOc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
96 :version "21.1"
35177
f7c511463b68 (vc-cvs-header): Fix :type.
Dave Love <fx@gnu.org>
parents: 35132
diff changeset
97 :type '(repeat string)
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 :group 'vc)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 (defcustom vc-cvs-use-edit t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
101 "Non-nil means to use `cvs edit' to \"check out\" a file.
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 This is only meaningful if you don't use the implicit checkout model
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 \(i.e. if you have $CVSREAD set)."
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 :type 'boolean
31475
b25e22223eb9 DOc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
105 :version "21.1"
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 :group 'vc)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107
98675
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
108 (defcustom vc-cvs-stay-local 'only-file
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
109 "Non-nil means use local operations when possible for remote repositories.
38288
6934c28c6bc5 (vc-cvs-stay-local): doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 37358
diff changeset
110 This avoids slow queries over the network and instead uses heuristics
6934c28c6bc5 (vc-cvs-stay-local): doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 37358
diff changeset
111 and past information to determine the current status of a file.
50671
0737c3a76291 (vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents: 50668
diff changeset
112
98675
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
113 If value is the symbol `only-file' `vc-dir' will connect to the
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
114 server, but heuristics will be used to determine the status for
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
115 all other VC operations.
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
116
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
117 The value can also be a regular expression or list of regular
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
118 expressions to match against the host name of a repository; then VC
50671
0737c3a76291 (vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents: 50668
diff changeset
119 only stays local for hosts that match it. Alternatively, the value
57913
f5d7d9bbc021 (vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 54465
diff changeset
120 can be a list of regular expressions where the first element is the
f5d7d9bbc021 (vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 54465
diff changeset
121 symbol `except'; then VC always stays local except for hosts matched
50671
0737c3a76291 (vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents: 50668
diff changeset
122 by these regular expressions."
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 :type '(choice (const :tag "Always stay local" t)
99190
e78a75586e10 (vc-cvs-stay-local): Fix typo in choice.
Martin Rudalics <rudalics@gmx.at>
parents: 99159
diff changeset
124 (const :tag "Only for file operations" only-file)
98675
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
125 (const :tag "Don't stay local" nil)
100186
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
126 (list :format "\nExamine hostname and %v"
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
127 :tag "Examine hostname ..."
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
128 (set :format "%v" :inline t
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
129 (const :format "%t" :tag "don't" except))
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
130 (regexp :format " stay local,\n%t: %v"
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
131 :tag "if it matches")
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
132 (repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
98576
5472a993dc3a (vc-cvs-dir-stay-local): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98532
diff changeset
133 :version "23.1"
5472a993dc3a (vc-cvs-dir-stay-local): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98532
diff changeset
134 :group 'vc)
5472a993dc3a (vc-cvs-dir-stay-local): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98532
diff changeset
135
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
136 (defcustom vc-cvs-sticky-date-format-string "%c"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
137 "Format string for mode-line display of sticky date.
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
138 Format is according to `format-time-string'. Only used if
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
139 `vc-cvs-sticky-tag-display' is t."
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
140 :type '(string)
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59443
diff changeset
141 :version "22.1"
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
142 :group 'vc)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
143
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
144 (defcustom vc-cvs-sticky-tag-display t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99498
diff changeset
145 "Specify the mode-line display of sticky tags.
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
146 Value t means default display, nil means no display at all. If the
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
147 value is a function or macro, it is called with the sticky tag and
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
148 its' type as parameters, in that order. TYPE can have three different
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
149 values: `symbolic-name' (TAG is a string), `revision-number' (TAG is a
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
150 string) and `date' (TAG is a date as returned by `encode-time'). The
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
151 return value of the function or macro will be displayed as a string.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
152
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
153 Here's an example that will display the formatted date for sticky
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
154 dates and the word \"Sticky\" for sticky tag names and revisions.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
155
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
156 (lambda (tag type)
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
157 (cond ((eq type 'date) (format-time-string
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
158 vc-cvs-sticky-date-format-string tag))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
159 ((eq type 'revision-number) \"Sticky\")
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
160 ((eq type 'symbolic-name) \"Sticky\")))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
161
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
162 Here's an example that will abbreviate to the first character only,
47917
ca7641fe56ba (vc-cvs-sticky-tag-display): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 47840
diff changeset
163 any text before the first occurrence of `-' for sticky symbolic tags.
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
164 If the sticky tag is a revision number, the word \"Sticky\" is
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
165 displayed. Date and time is displayed for sticky dates.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
166
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
167 (lambda (tag type)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
168 (cond ((eq type 'date) (format-time-string \"%Y%m%d %H:%M\" tag))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
169 ((eq type 'revision-number) \"Sticky\")
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
170 ((eq type 'symbolic-name)
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
171 (condition-case nil
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
172 (progn
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
173 (string-match \"\\\\([^-]*\\\\)\\\\(.*\\\\)\" tag)
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
174 (concat (substring (match-string 1 tag) 0 1) \":\"
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
175 (substring (match-string 2 tag) 1 nil)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
176 (error tag))))) ; Fall-back to given tag name.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
177
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
178 See also variable `vc-cvs-sticky-date-format-string'."
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
179 :type '(choice boolean function)
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59443
diff changeset
180 :version "22.1"
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
181 :group 'vc)
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
182
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
183 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
184 ;;; Internal variables
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
185 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
186
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
187
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
188 ;;;
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
189 ;;; State-querying functions
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
190 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
191
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 ;;;###autoload (defun vc-cvs-registered (f)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 ;;;###autoload (when (file-readable-p (expand-file-name
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194 ;;;###autoload "CVS/Entries" (file-name-directory f)))
47811
8b1c72f30fea (vc-cvs-registered): In the autoload version use load instead of
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47807
diff changeset
195 ;;;###autoload (load "vc-cvs")
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
196 ;;;###autoload (vc-cvs-registered f)))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 (defun vc-cvs-registered (file)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 "Check if FILE is CVS registered."
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200 (let ((dirname (or (file-name-directory file) ""))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
201 (basename (file-name-nondirectory file))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202 ;; make sure that the file name is searched case-sensitively
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
203 (case-fold-search nil))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204 (if (file-readable-p (expand-file-name "CVS/Entries" dirname))
95591
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
205 (or (string= basename "")
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
206 (with-temp-buffer
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
207 (vc-cvs-get-entries dirname)
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
208 (goto-char (point-min))
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
209 (cond ((re-search-forward
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
210 (concat "^/" (regexp-quote basename) "/[^/]") nil t)
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
211 (beginning-of-line)
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
212 (vc-cvs-parse-entry file)
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
213 t)
fff438dcde9e (vc-cvs-registered): Consider a directory with a CVS subdirectory to be registered.
Sam Steingold <sds@gnu.org>
parents: 95524
diff changeset
214 (t nil))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
215 nil)))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 (defun vc-cvs-state (file)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
218 "CVS-specific version of `vc-state'."
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
219 (if (vc-stay-local-p file 'CVS)
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
220 (let ((state (vc-file-getprop file 'vc-state)))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
221 ;; If we should stay local, use the heuristic but only if
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222 ;; we don't have a more precise state already available.
58640
0241e1689d7f (vc-cvs-state): Handle the case where vc-state is still nil.
André Spiegel <spiegel@gnu.org>
parents: 57916
diff changeset
223 (if (memq state '(up-to-date edited nil))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224 (vc-cvs-state-heuristic file)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225 state))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 (with-temp-buffer
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 (cd (file-name-directory file))
104596
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
228 (let (process-file-side-effects)
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
229 (vc-cvs-command t 0 file "status"))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
230 (vc-cvs-parse-status t))))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
231
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
232 (defun vc-cvs-state-heuristic (file)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 "CVS-specific state heuristic."
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234 ;; If the file has not changed since checkout, consider it `up-to-date'.
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235 ;; Otherwise consider it `edited'.
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 (lastmod (nth 5 (file-attributes file))))
93124
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
238 (cond
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
239 ((equal checkout-time lastmod) 'up-to-date)
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
240 ((string= (vc-working-revision file) "0") 'added)
95425
72ac0c4a8ecd (vc-cvs-state-heuristic, vc-cvs-parse-status): Try and
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95321
diff changeset
241 ((null checkout-time) 'unregistered)
93124
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
242 (t 'edited))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
244 (defun vc-cvs-working-revision (file)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
245 "CVS-specific version of `vc-working-revision'."
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
246 ;; There is no need to consult RCS headers under CVS, because we
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
247 ;; get the workfile version for free when we recognize that a file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
248 ;; is registered in CVS.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
249 (vc-cvs-registered file)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
250 (vc-file-getprop file 'vc-working-revision))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
251
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31384
diff changeset
252 (defun vc-cvs-mode-line-string (file)
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31384
diff changeset
253 "Return string for placement into the modeline for FILE.
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
254 Compared to the default implementation, this function does two things:
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
255 Handle the special case of a CVS file that is added but not yet
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
256 committed and support display of sticky tags."
82027
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
257 (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
258 help-echo
93124
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
259 (string
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
260 (let ((def-ml (vc-default-mode-line-string 'CVS file)))
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
261 (setq help-echo
93124
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
262 (get-text-property 0 'help-echo def-ml))
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
263 def-ml)))
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
264 (propertize
82027
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
265 (if (zerop (length sticky-tag))
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
266 string
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
267 (setq help-echo (format "%s on the '%s' branch"
82027
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
268 help-echo sticky-tag))
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
269 (concat string "[" sticky-tag "]"))
1350ba0c0448 * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents: 81988
diff changeset
270 'help-echo help-echo)))
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31384
diff changeset
271
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
272
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
273 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
274 ;;; State-changing functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
275 ;;;
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
276
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
277 (defun vc-cvs-register (files &optional rev comment)
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
278 "Register FILES into the CVS version-control system.
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
279 COMMENT can be used to provide an initial description of FILES.
100202
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
280 Passes either `vc-cvs-register-switches' or `vc-register-switches'
d2b36bcb9a82 (vc-cvs-register-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100186
diff changeset
281 to the CVS command."
92163
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
282 ;; Register the directories if needed.
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
283 (let (dirs)
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
284 (dolist (file files)
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
285 (and (not (vc-cvs-responsible-p file))
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
286 (vc-cvs-could-register file)
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
287 (push (directory-file-name (file-name-directory file)) dirs)))
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
288 (if dirs (vc-cvs-register dirs)))
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
289 (apply 'vc-cvs-command nil 0 files
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
290 "add"
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
291 (and comment (string-match "[^\t\n ]" comment)
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
292 (concat "-m" comment))
12326ccb66d6 (vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents: 91956
diff changeset
293 (vc-switches 'CVS 'register)))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
294
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
295 (defun vc-cvs-responsible-p (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
296 "Return non-nil if CVS thinks it is responsible for FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
297 (file-directory-p (expand-file-name "CVS"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
298 (if (file-directory-p file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
299 file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
300 (file-name-directory file)))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
301
51733
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
302 (defun vc-cvs-could-register (file)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
303 "Return non-nil if FILE could be registered in CVS.
51733
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
304 This is only possible if CVS is managing FILE's directory or one of
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
305 its parents."
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
306 (let ((dir file))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
307 (while (and (stringp dir)
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
308 (not (equal dir (setq dir (file-name-directory dir))))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
309 dir)
100214
188994c9d7fe (vc-cvs-could-register): Don't use file-directory-p to
Lute Kamstra <lute@gnu.org>
parents: 100202
diff changeset
310 (setq dir (if (file-exists-p
51733
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
311 (expand-file-name "CVS/Entries" dir))
100214
188994c9d7fe (vc-cvs-could-register): Don't use file-directory-p to
Lute Kamstra <lute@gnu.org>
parents: 100202
diff changeset
312 t
188994c9d7fe (vc-cvs-could-register): Don't use file-directory-p to
Lute Kamstra <lute@gnu.org>
parents: 100202
diff changeset
313 (directory-file-name dir))))
51733
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
314 (eq dir t)))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
315
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 107193
diff changeset
316 (defun vc-cvs-checkin (files rev comment &optional extra-args-ignored)
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
317 "CVS-specific version of `vc-backend-checkin'."
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
318 (unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
50910
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
319 (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
320 (error "%s is not a valid symbolic tag name" rev)
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
321 ;; If the input revison is a valid symbolic tag name, we create it
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
322 ;; as a branch, commit and switch to it.
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
323 (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
324 (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
81976
69946487f7b5 Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81962
diff changeset
325 (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
69946487f7b5 Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81962
diff changeset
326 files)))
69946487f7b5 Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81962
diff changeset
327 (let ((status (apply 'vc-cvs-command nil 1 files
50910
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
328 "ci" (if rev (concat "-r" rev))
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
329 (concat "-m" comment)
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
330 (vc-switches 'CVS 'checkin))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
331 (set-buffer "*vc*")
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
332 (goto-char (point-min))
32948
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
333 (when (not (zerop status))
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
334 ;; Check checkin problem.
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
335 (cond
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
336 ((re-search-forward "Up-to-date check failed" nil t)
81977
ef9ebdaeea06 vc-cvs-checkin had some reference problems, now fixed.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81976
diff changeset
337 (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
ef9ebdaeea06 vc-cvs-checkin had some reference problems, now fixed.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81976
diff changeset
338 files)
87139
f358a2fd5895 Fix buggy calls to `error'.
Deepak Goel <deego@gnufans.org>
parents: 86041
diff changeset
339 (error "%s" (substitute-command-keys
32948
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
340 (concat "Up-to-date check failed: "
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
341 "type \\[vc-next-action] to merge in changes"))))
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
342 (t
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
343 (pop-to-buffer (current-buffer))
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
344 (goto-char (point-min))
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
345 (shrink-window-if-larger-than-buffer)
3c95af2888f6 (vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents: 32747
diff changeset
346 (error "Check-in failed"))))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
347 ;; Single-file commit? Then update the revision by parsing the buffer.
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
348 ;; Otherwise we can't necessarily tell what goes with what; clear
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
349 ;; its properties so they have to be refetched.
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
350 (if (= (length files) 1)
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
351 (vc-file-setprop
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
352 (car files) 'vc-working-revision
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
353 (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
94481
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94210
diff changeset
354 (mapc 'vc-file-clearprops files))
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
355 ;; Anyway, forget the checkout model of the file, because we might have
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
356 ;; guessed wrong when we found the file. After commit, we can
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
357 ;; tell it from the permissions of the file (see
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
358 ;; vc-cvs-checkout-model).
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
359 (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
360 files)
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
361
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
362 ;; if this was an explicit check-in (does not include creation of
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
363 ;; a branch), remove the sticky tag.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
364 (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
365 (vc-cvs-command nil 0 files "update" "-A"))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
366
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
367 (defun vc-cvs-find-revision (file rev buffer)
47799
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
368 (apply 'vc-cvs-command
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
369 buffer 0 file
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
370 "-Q" ; suppress diagnostic output
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
371 "update"
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
372 (and rev (not (string= rev ""))
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
373 (concat "-r" rev))
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
374 "-p"
50910
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
375 (vc-switches 'CVS 'checkout)))
47799
0d2f83a91144 (vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47758
diff changeset
376
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
377 (defun vc-cvs-checkout (file &optional editable rev)
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
378 "Checkout a revision of FILE into the working area.
35132
78bce41f17c5 (vc-cvs-latest-on-branch-p): Removed.
André Spiegel <spiegel@gnu.org>
parents: 33637
diff changeset
379 EDITABLE non-nil means that the file should be writable.
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
380 REV is the revision to check out."
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
381 (message "Checking out %s..." file)
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
382 ;; Change buffers to get local value of vc-checkout-switches.
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
383 (with-current-buffer (or (get-file-buffer file) (current-buffer))
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
384 (if (and (file-exists-p file) (not rev))
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
385 ;; If no revision was specified, just make the file writable
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
386 ;; if necessary (using `cvs-edit' if requested).
94563
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
387 (and editable (not (eq (vc-cvs-checkout-model (list file)) 'implicit))
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
388 (if vc-cvs-use-edit
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
389 (vc-cvs-command nil 0 file "edit")
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
390 (set-file-modes file (logior (file-modes file) 128))
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
391 (if (equal file buffer-file-name) (toggle-read-only -1))))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
392 ;; Check out a particular revision (or recreate the file).
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
393 (vc-file-setprop file 'vc-working-revision nil)
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
394 (apply 'vc-cvs-command nil 0 file
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
395 (and editable "-w")
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
396 "update"
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
397 (when rev
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
398 (unless (eq rev t)
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
399 ;; default for verbose checkout: clear the
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
400 ;; sticky tag so that the actual update will
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
401 ;; get the head of the trunk
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
402 (if (string= rev "")
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
403 "-A"
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
404 (concat "-r" rev))))
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
405 (vc-switches 'CVS 'checkout)))
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
406 (vc-mode-line file 'CVS))
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
407 (message "Checking out %s...done" file))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
408
50923
3eab629b1239 (vc-cvs-mode-line-string): Use vc-default-mode-line-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50910
diff changeset
409 (defun vc-cvs-delete-file (file)
94534
37fa7ba3820c Don't commit right after deletion.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94522
diff changeset
410 (vc-cvs-command nil 0 file "remove" "-f"))
50923
3eab629b1239 (vc-cvs-mode-line-string): Use vc-default-mode-line-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50910
diff changeset
411
39001
d13c2139752b (vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents: 38288
diff changeset
412 (defun vc-cvs-revert (file &optional contents-done)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
413 "Revert FILE to the working revision on which it was based."
81764
12e5ff38b024 (vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
414 (vc-default-revert 'CVS file contents-done)
94563
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94542
diff changeset
415 (unless (eq (vc-cvs-checkout-model (list file)) 'implicit)
39001
d13c2139752b (vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents: 38288
diff changeset
416 (if vc-cvs-use-edit
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
417 (vc-cvs-command nil 0 file "unedit")
39001
d13c2139752b (vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents: 38288
diff changeset
418 ;; Make the file read-only by switching off all w-bits
d13c2139752b (vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents: 38288
diff changeset
419 (set-file-modes file (logand (file-modes file) 3950)))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
420
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
421 (defun vc-cvs-merge (file first-revision &optional second-revision)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
422 "Merge changes into current working copy of FILE.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
423 The changes are between FIRST-REVISION and SECOND-REVISION."
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
424 (vc-cvs-command nil 0 file
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
425 "update" "-kk"
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
426 (concat "-j" first-revision)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
427 (concat "-j" second-revision))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
428 (vc-file-setprop file 'vc-state 'edited)
50645
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
429 (with-current-buffer (get-buffer "*vc*")
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
430 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
431 (if (re-search-forward "conflicts during merge" nil t)
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
432 (progn
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
433 (vc-file-setprop file 'vc-state 'conflict)
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
434 ;; signal error
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
435 1)
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
436 (vc-file-setprop file 'vc-state 'edited)
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
437 ;; signal success
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
438 0)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
439
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
440 (defun vc-cvs-merge-news (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
441 "Merge in any new changes made to FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
442 (message "Merging changes into %s..." file)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
443 ;; (vc-file-setprop file 'vc-working-revision nil)
50645
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
444 (vc-file-setprop file 'vc-checkout-time 0)
87739
28dc34f6a246 * vc.el (vc-update): Resolve conflicts if necessary instead of
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87649
diff changeset
445 (vc-cvs-command nil nil file "update")
50645
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
446 ;; Analyze the merge result reported by CVS, and set
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
447 ;; file properties accordingly.
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
448 (with-current-buffer (get-buffer "*vc*")
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
449 (goto-char (point-min))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
450 ;; get new working revision
50645
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
451 (if (re-search-forward
4b6925d144de (vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50453
diff changeset
452 "^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
453 (vc-file-setprop file 'vc-working-revision (match-string 1))
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
454 (vc-file-setprop file 'vc-working-revision nil))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
455 ;; get file status
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
456 (prog1
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
457 (if (eq (buffer-size) 0)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
458 0 ;; there were no news; indicate success
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
459 (if (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
460 (concat "^\\([CMUP] \\)?"
103747
4f648d5b56cd (vc-cvs-merge-news): Fix message parsing for non-top-level files.
Sam Steingold <sds@gnu.org>
parents: 103553
diff changeset
461 (regexp-quote
107193
dd61cb49d199 (vc-cvs-merge-news): Yet another fix of message parsing.
Sam Steingold <sds@gnu.org>
parents: 106815
diff changeset
462 (substring file (1+ (length (expand-file-name
dd61cb49d199 (vc-cvs-merge-news): Yet another fix of message parsing.
Sam Steingold <sds@gnu.org>
parents: 106815
diff changeset
463 "." default-directory)))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
464 "\\( already contains the differences between \\)?")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
465 nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
466 (cond
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
467 ;; Merge successful, we are in sync with repository now
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
468 ((or (match-string 2)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
469 (string= (match-string 1) "U ")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
470 (string= (match-string 1) "P "))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
471 (vc-file-setprop file 'vc-state 'up-to-date)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
472 (vc-file-setprop file 'vc-checkout-time
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
473 (nth 5 (file-attributes file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
474 0);; indicate success to the caller
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
475 ;; Merge successful, but our own changes are still in the file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
476 ((string= (match-string 1) "M ")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
477 (vc-file-setprop file 'vc-state 'edited)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
478 0);; indicate success to the caller
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
479 ;; Conflicts detected!
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
480 (t
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
481 (vc-file-setprop file 'vc-state 'conflict)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
482 1);; signal the error to the caller
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
483 )
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
484 (pop-to-buffer "*vc*")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
485 (error "Couldn't analyze cvs update result")))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
486 (message "Merging changes into %s...done" file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
487
87432
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87427
diff changeset
488 (defun vc-cvs-modify-change-comment (files rev comment)
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
489 "Modify the change comments for FILES on a specified REV.
87432
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87427
diff changeset
490 Will fail unless you have administrative privileges on the repo."
93867
520490ae1b9a * vc-rcs.el (vc-rcs-modify-change-comment):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93461
diff changeset
491 (vc-cvs-command nil 0 files "admin" (concat "-m" rev ":" comment)))
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
492
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
493 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
494 ;;; History functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
495 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
496
104711
adeed914a5fb * vc.el (vc-print-log-internal): Move RCS/CVS specific code ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104625
diff changeset
497 (declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
adeed914a5fb * vc.el (vc-print-log-internal): Move RCS/CVS specific code ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104625
diff changeset
498
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
499 (defun vc-cvs-print-log (files buffer &optional shortlog start-revision-ignored limit)
87427
1aea302af710 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87424
diff changeset
500 "Get change logs associated with FILES."
104711
adeed914a5fb * vc.el (vc-print-log-internal): Move RCS/CVS specific code ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104625
diff changeset
501 (require 'vc-rcs)
87427
1aea302af710 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87424
diff changeset
502 ;; It's just the catenation of the individual logs.
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
503 (vc-cvs-command
54465
2e4ddb8bfffd (vc-cvs-print-log, vc-cvs-diff): Add optional BUFFER argument.
André Spiegel <spiegel@gnu.org>
parents: 53631
diff changeset
504 buffer
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
505 (if (vc-stay-local-p files 'CVS) 'async 0)
104711
adeed914a5fb * vc.el (vc-print-log-internal): Move RCS/CVS specific code ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104625
diff changeset
506 files "log")
adeed914a5fb * vc.el (vc-print-log-internal): Move RCS/CVS specific code ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104625
diff changeset
507 (with-current-buffer buffer
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
508 (vc-exec-after (vc-rcs-print-log-cleanup)))
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
509 (when limit 'limit-unsupported))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
510
94806
eedf64b515f0 Remove wash-log from the VC backend API.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94729
diff changeset
511 (defun vc-cvs-comment-history (file)
eedf64b515f0 Remove wash-log from the VC backend API.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94729
diff changeset
512 "Get comment history of a file."
eedf64b515f0 Remove wash-log from the VC backend API.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94729
diff changeset
513 (vc-call-backend 'RCS 'comment-history file))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
514
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
515 (defun vc-cvs-diff (files &optional oldvers newvers buffer)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
516 "Get a difference report using CVS between two revisions of FILE."
104596
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
517 (let* (process-file-side-effects
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
518 (async (and (not vc-disable-async-diff)
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
519 (vc-stay-local-p files 'CVS)))
86041
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
520 (invoke-cvs-diff-list nil)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
521 status)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
522 ;; Look through the file list and see if any files have backups
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
523 ;; that can be used to do a plain "diff" instead of "cvs diff".
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
524 (dolist (file files)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
525 (let ((ov oldvers)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
526 (nv newvers))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
527 (when (or (not ov) (string-equal ov ""))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
528 (setq ov (vc-working-revision file)))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
529 (when (string-equal nv "")
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
530 (setq nv nil))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
531 (let ((file-oldvers (vc-version-backup-file file ov))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
532 (file-newvers (if (not nv)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
533 file
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
534 (vc-version-backup-file file nv)))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
535 (coding-system-for-read (vc-coding-system-for-diff file)))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
536 (if (and file-oldvers file-newvers)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
537 (progn
100186
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
538 ;; This used to append diff-switches and vc-diff-switches,
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
539 ;; which was consistent with the vc-diff-switches doc at that
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
540 ;; time, but not with the actual behavior of any other VC diff.
86041
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
541 (apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil
100186
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
542 ;; Not a CVS diff, does not use vc-cvs-diff-switches.
c9d564389052 (vc-cvs-diff-switches): Doc fix. Add t as option.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
543 (append (vc-switches nil 'diff)
86041
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
544 (list (file-relative-name file-oldvers)
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
545 (file-relative-name file-newvers))))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
546 (setq status 0))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
547 (push file invoke-cvs-diff-list)))))
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
548 (when invoke-cvs-diff-list
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
549 (setq status (apply 'vc-cvs-command (or buffer "*vc-diff*")
50910
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
550 (if async 'async 1)
86041
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
551 invoke-cvs-diff-list "diff"
50910
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
552 (and oldvers (concat "-r" oldvers))
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
553 (and newvers (concat "-r" newvers))
8c4130079acf (vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50909
diff changeset
554 (vc-switches 'CVS 'diff))))
86041
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
555 (if async 1 status))) ; async diff, pessimistic assumption
62a404545514 (vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86002
diff changeset
556
81820
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
557 (defconst vc-cvs-annotate-first-line-re "^[0-9]")
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
558
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
559 (defun vc-cvs-annotate-process-filter (process string)
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
560 (setq string (concat (process-get process 'output) string))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
561 (if (not (string-match vc-cvs-annotate-first-line-re string))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
562 ;; Still waiting for the first real line.
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
563 (process-put process 'output string)
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
564 (let ((vc-filter (process-get process 'vc-filter)))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
565 (set-process-filter process vc-filter)
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
566 (funcall vc-filter process (substring string (match-beginning 0))))))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
567
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
568 (defun vc-cvs-annotate-command (file buffer &optional revision)
33545
5411250e7971 (vc-cvs-annotate-command): New optional arg VERSION. Use
André Spiegel <spiegel@gnu.org>
parents: 32959
diff changeset
569 "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
570 Optional arg REVISION is a revision to annotate from."
81820
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
571 (vc-cvs-command buffer
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
572 (if (vc-stay-local-p file 'CVS)
81820
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
573 'async 0)
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
574 file "annotate"
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
575 (if revision (concat "-r" revision)))
81820
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
576 ;; Strip the leading few lines.
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
577 (let ((proc (get-buffer-process buffer)))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
578 (if proc
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
579 ;; If running asynchronously, use a process filter.
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
580 (progn
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
581 (process-put proc 'vc-filter (process-filter proc))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
582 (set-process-filter proc 'vc-cvs-annotate-process-filter))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
583 (with-current-buffer buffer
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
584 (goto-char (point-min))
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
585 (re-search-forward vc-cvs-annotate-first-line-re)
37a7f9bddc45 (vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81764
diff changeset
586 (delete-region (point-min) (1- (point)))))))
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
587
96213
09da7727f35f * vc-hg.el (vc-annotate-convert-time, vc-default-status-printer):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96123
diff changeset
588 (declare-function vc-annotate-convert-time "vc-annotate" (time))
09da7727f35f * vc-hg.el (vc-annotate-convert-time, vc-default-status-printer):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96123
diff changeset
589
40171
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
590 (defun vc-cvs-annotate-current-time ()
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
591 "Return the current time, based at midnight of the current day, and
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
592 encoded as fractional days."
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
593 (vc-annotate-convert-time
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
594 (apply 'encode-time 0 0 0 (nthcdr 3 (decode-time (current-time))))))
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
595
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
596 (defun vc-cvs-annotate-time ()
91eda91380cb New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40125
diff changeset
597 "Return the time of the next annotation (as fraction of days)
42206
0f4506820432 Doc fix.
Pavel Janík <Pavel@Janik.cz>
parents: 41707
diff changeset
598 systime, or nil if there is none."
57916
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
599 (let* ((bol (point))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
600 (cache (get-text-property bol 'vc-cvs-annotate-time))
84583
52ca2a6a41bf (vc-cvs-annotate-time): Use inhibit-read-only and inhibit-modification-hooks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
601 (inhibit-read-only t)
52ca2a6a41bf (vc-cvs-annotate-time): Use inhibit-read-only and inhibit-modification-hooks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
602 (inhibit-modification-hooks t))
57916
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
603 (cond
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
604 (cache)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
605 ((looking-at
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
606 "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ")
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
607 (let ((day (string-to-number (match-string 1)))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
608 (month (cdr (assq (intern (match-string 2))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
609 '((Jan . 1) (Feb . 2) (Mar . 3)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
610 (Apr . 4) (May . 5) (Jun . 6)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
611 (Jul . 7) (Aug . 8) (Sep . 9)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
612 (Oct . 10) (Nov . 11) (Dec . 12)))))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
613 (year (let ((tmp (string-to-number (match-string 3))))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
614 ;; Years 0..68 are 2000..2068.
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
615 ;; Years 69..99 are 1969..1999.
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
616 (+ (cond ((> 69 tmp) 2000)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
617 ((> 100 tmp) 1900)
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
618 (t 0))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
619 tmp))))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
620 (put-text-property
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
621 bol (1+ bol) 'vc-cvs-annotate-time
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
622 (setq cache (cons
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
623 ;; Position at end makes for nicer overlay result.
79690
be4e5f45a3eb (vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78359
diff changeset
624 ;; Don't put actual buffer pos here, but only relative
be4e5f45a3eb (vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78359
diff changeset
625 ;; distance, so we don't ever move backward in the
be4e5f45a3eb (vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78359
diff changeset
626 ;; goto-char below, even if the text is moved.
be4e5f45a3eb (vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78359
diff changeset
627 (- (match-end 0) (match-beginning 0))
57916
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
628 (vc-annotate-convert-time
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
629 (encode-time 0 0 0 day month year))))))))
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
630 (when cache
79690
be4e5f45a3eb (vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78359
diff changeset
631 (goto-char (+ bol (car cache))) ; Fontify from here to eol.
57916
990dbd4941c8 (vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57913
diff changeset
632 (cdr cache)))) ; days (float)
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
633
53631
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
634 (defun vc-cvs-annotate-extract-revision-at-line ()
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
635 (save-excursion
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
636 (beginning-of-line)
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
637 (if (re-search-forward "^\\([0-9]+\\.[0-9]+\\(\\.[0-9]+\\)*\\) +("
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
638 (line-end-position) t)
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
639 (match-string-no-properties 1)
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
640 nil)))
74e44ab76fa5 * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents: 52717
diff changeset
641
104625
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
642 (defun vc-cvs-previous-revision (file rev)
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
643 (vc-call-backend 'RCS 'previous-revision file rev))
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
644
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
645 (defun vc-cvs-next-revision (file rev)
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
646 (vc-call-backend 'RCS 'next-revision file rev))
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
647
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
648 ;; FIXME: This should probably be replaced by code using cvs2cl.
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
649 (defun vc-cvs-update-changelog (files)
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
650 (vc-call-backend 'RCS 'update-changelog files))
97ec4e51e2eb (vc-cvs-update-changelog): Fix typo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104596
diff changeset
651
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
652 ;;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94847
diff changeset
653 ;;; Tag system
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
654 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
655
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94847
diff changeset
656 (defun vc-cvs-create-tag (dir name branchp)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
657 "Assign to DIR's current revision a given NAME.
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
658 If BRANCHP is non-nil, the name is created as a branch (and the current
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
659 workspace is immediately moved to that new branch)."
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
660 (vc-cvs-command nil 0 dir "tag" "-c" (if branchp "-b") name)
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
661 (when branchp (vc-cvs-command nil 0 dir "update" "-r" name)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
662
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94847
diff changeset
663 (defun vc-cvs-retrieve-tag (dir name update)
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94847
diff changeset
664 "Retrieve a tag at and below DIR.
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94847
diff changeset
665 NAME is the name of the tag; if it is empty, do a `cvs update'.
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
666 If UPDATE is non-nil, then update (resynch) any affected buffers."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
667 (with-current-buffer (get-buffer-create "*vc*")
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
668 (let ((default-directory dir)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
669 (sticky-tag))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
670 (erase-buffer)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
671 (if (or (not name) (string= name ""))
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
672 (vc-cvs-command t 0 nil "update")
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
673 (vc-cvs-command t 0 nil "update" "-r" name)
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
674 (setq sticky-tag name))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
675 (when update
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
676 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
677 (while (not (eobp))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
678 (if (looking-at "\\([CMUP]\\) \\(.*\\)")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
679 (let* ((file (expand-file-name (match-string 2) dir))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
680 (state (match-string 1))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
681 (buffer (find-buffer-visiting file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
682 (when buffer
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
683 (cond
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
684 ((or (string= state "U")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
685 (string= state "P"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
686 (vc-file-setprop file 'vc-state 'up-to-date)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
687 (vc-file-setprop file 'vc-working-revision nil)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
688 (vc-file-setprop file 'vc-checkout-time
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
689 (nth 5 (file-attributes file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
690 ((or (string= state "M")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
691 (string= state "C"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
692 (vc-file-setprop file 'vc-state 'edited)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
693 (vc-file-setprop file 'vc-working-revision nil)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
694 (vc-file-setprop file 'vc-checkout-time 0)))
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
695 (vc-file-setprop file 'vc-cvs-sticky-tag sticky-tag)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
696 (vc-resynch-buffer file t t))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
697 (forward-line 1))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
698
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
699
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
700 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
701 ;;; Miscellaneous
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
702 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
703
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
704 (defun vc-cvs-make-version-backups-p (file)
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
705 "Return non-nil if version backups should be made for FILE."
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
706 (vc-stay-local-p file 'CVS))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
707
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
708 (defun vc-cvs-check-headers ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
709 "Check if the current file has any headers in it."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
710 (save-excursion
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
711 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
712 (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
713 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
714
35569
5cd8ebba5a94 doc&comment fix
Sam Steingold <sds@gnu.org>
parents: 35177
diff changeset
715
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
716 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
717 ;;; Internal functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
718 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
719
81962
0744b309302b Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81821
diff changeset
720 (defun vc-cvs-command (buffer okstatus files &rest flags)
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
721 "A wrapper around `vc-do-command' for use in vc-cvs.el.
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
722 The difference to vc-do-command is that this function always invokes `cvs',
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
723 and that it passes `vc-cvs-global-switches' to it before FLAGS."
94847
5e64dca662f0 Remove assumption about what nil means as a first arument to vc-do-command.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94806
diff changeset
724 (apply 'vc-do-command (or buffer "*vc*") okstatus "cvs" files
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
725 (if (stringp vc-cvs-global-switches)
44197
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
726 (cons vc-cvs-global-switches flags)
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
727 (append vc-cvs-global-switches
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
728 flags))))
e255f8fa4f62 (vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 44104
diff changeset
729
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
730 (defun vc-cvs-stay-local-p (file) ;Back-compatibility.
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
731 (vc-stay-local-p file 'CVS))
51733
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
732
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
733 (defun vc-cvs-repository-hostname (dirname)
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
734 "Hostname of the CVS server associated to workarea DIRNAME."
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
735 (let ((rootname (expand-file-name "CVS/Root" dirname)))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
736 (when (file-readable-p rootname)
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
737 (with-temp-buffer
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
738 (let ((coding-system-for-read
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
739 (or file-name-coding-system
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
740 default-file-name-coding-system)))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
741 (vc-insert-file rootname))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
742 (goto-char (point-min))
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
743 (nth 2 (vc-cvs-parse-root
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
744 (buffer-substring (point)
2b72fd42f02e (vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51164
diff changeset
745 (line-end-position))))))))
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
746
99498
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
747 (defun vc-cvs-parse-uhp (path)
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
748 "parse user@host/path into (user@host /path)"
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
749 (if (string-match "\\([^/]+\\)\\(/.*\\)" path)
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
750 (list (match-string 1 path) (match-string 2 path))
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
751 (list nil path)))
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
752
50898
8806616471e2 (vc-cvs-dired-state-info): Use `added' for added files and
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50671
diff changeset
753 (defun vc-cvs-parse-root (root)
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
754 "Split CVS ROOT specification string into a list of fields.
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
755 A CVS root specification of the form
99498
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
756 [:METHOD:][[USER@]HOSTNAME]:?/path/to/repository
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
757 is converted to a normalized record with the following structure:
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
758 \(METHOD USER HOSTNAME CVS-ROOT).
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
759 The default METHOD for a CVS root of the form
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
760 /path/to/repository
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
761 is `local'.
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
762 The default METHOD for a CVS root of the form
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
763 [USER@]HOSTNAME:/path/to/repository
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
764 is `ext'.
60912
4a2ea521d778 * vc-cvs.el: Replace `illegal' with `invalid'.
Werner LEMBERG <wl@gnu.org>
parents: 59996
diff changeset
765 For an empty string, nil is returned (invalid CVS root)."
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
766 ;; Split CVS root into colon separated fields (0-4).
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
767 ;; The `x:' makes sure, that leading colons are not lost;
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
768 ;; `HOST:/PATH' is then different from `:METHOD:/PATH'.
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
769 (let* ((root-list (cdr (split-string (concat "x:" root) ":")))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
770 (len (length root-list))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
771 ;; All syntactic varieties will get a proper METHOD.
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
772 (root-list
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
773 (cond
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
774 ((= len 0)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
775 ;; Invalid CVS root
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
776 nil)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
777 ((= len 1)
99498
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
778 (let ((uhp (vc-cvs-parse-uhp (car root-list))))
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
779 (cons (if (car uhp) "ext" "local") uhp)))
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
780 ((= len 2)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
781 ;; [USER@]HOST:PATH => method `ext'
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
782 (and (not (equal (car root-list) ""))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
783 (cons "ext" root-list)))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
784 ((= len 3)
99498
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
785 ;; :METHOD:PATH or :METHOD:USER@HOSTNAME/PATH
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
786 (cons (cadr root-list)
99498
ea9a7a9912a9 (vc-cvs-parse-root): Handle roots without colon between hostname and path.
Sam Steingold <sds@gnu.org>
parents: 99363
diff changeset
787 (vc-cvs-parse-uhp (caddr root-list))))
50668
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
788 (t
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
789 ;; :METHOD:[USER@]HOST:PATH
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
790 (cdr root-list)))))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
791 (if root-list
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
792 (let ((method (car root-list))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
793 (uhost (or (cadr root-list) ""))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
794 (root (nth 2 root-list))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
795 user host)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
796 ;; Split USER@HOST
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
797 (if (string-match "\\(.*\\)@\\(.*\\)" uhost)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
798 (setq user (match-string 1 uhost)
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
799 host (match-string 2 uhost))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
800 (setq host uhost))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
801 ;; Remove empty HOST
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
802 (and (equal host "")
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
803 (setq host))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
804 ;; Fix windows style CVS root `:local:C:\\project\\cvs\\some\\dir'
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
805 (and host
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
806 (equal method "local")
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
807 (setq root (concat host ":" root) host))
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
808 ;; Normalize CVS root record
01d84e9d30e0 Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents: 50645
diff changeset
809 (list method user host root)))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
810
93160
22d835ffa8f7 (vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93149
diff changeset
811 ;; XXX: This does not work correctly for subdirectories. "cvs status"
22d835ffa8f7 (vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93149
diff changeset
812 ;; information is context sensitive, it contains lines like:
22d835ffa8f7 (vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93149
diff changeset
813 ;; cvs status: Examining DIRNAME
22d835ffa8f7 (vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93149
diff changeset
814 ;; and the file entries after that don't show the full path.
94542
16651da1e3ed Fix some comments to remove references to vc-dired.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94534
diff changeset
815 ;; Because of this VC directory listings only show changed files
16651da1e3ed Fix some comments to remove references to vc-dired.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94534
diff changeset
816 ;; at the top level for CVS.
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
817 (defun vc-cvs-parse-status (&optional full)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
818 "Parse output of \"cvs status\" command in the current buffer.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
819 Set file properties accordingly. Unless FULL is t, parse only
87450
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
820 essential information. Note that this can never set the 'ignored
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
821 state."
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
822 (let (file status missing)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
823 (goto-char (point-min))
87450
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
824 (while (looking-at "? \\(.*\\)")
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
825 (setq file (expand-file-name (match-string 1)))
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
826 (vc-file-setprop file 'vc-state 'unregistered)
71fc7b1db920 * vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87449
diff changeset
827 (forward-line 1))
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
828 (when (re-search-forward "^File: " nil t)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
829 (when (setq missing (looking-at "no file "))
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
830 (goto-char (match-end 0)))
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
831 (cond
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
832 ((re-search-forward "\\=\\([^ \t]+\\)" nil t)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
833 (setq file (expand-file-name (match-string 1)))
95425
72ac0c4a8ecd (vc-cvs-state-heuristic, vc-cvs-parse-status): Try and
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95321
diff changeset
834 (setq status(if (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)
72ac0c4a8ecd (vc-cvs-state-heuristic, vc-cvs-parse-status): Try and
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95321
diff changeset
835 (match-string 1) "Unknown"))
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
836 (when (and full
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
837 (re-search-forward
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
838 "\\(RCS Version\\|RCS Revision\\|Repository revision\\):\
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
839 \[\t ]+\\([0-9.]+\\)"
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
840 nil t))
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
841 (vc-file-setprop file 'vc-latest-revision (match-string 2)))
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
842 (vc-file-setprop
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
843 file 'vc-state
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
844 (cond
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
845 ((string-match "Up-to-date" status)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
846 (vc-file-setprop file 'vc-checkout-time
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
847 (nth 5 (file-attributes file)))
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
848 'up-to-date)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
849 ((string-match "Locally Modified" status) 'edited)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
850 ((string-match "Needs Merge" status) 'needs-merge)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
851 ((string-match "Needs \\(Checkout\\|Patch\\)" status)
94521
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94481
diff changeset
852 (if missing 'missing 'needs-update))
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
853 ((string-match "Locally Added" status) 'added)
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
854 ((string-match "Locally Removed" status) 'removed)
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93941
diff changeset
855 ((string-match "File had conflicts " status) 'conflict)
95425
72ac0c4a8ecd (vc-cvs-state-heuristic, vc-cvs-parse-status): Try and
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95321
diff changeset
856 ((string-match "Unknown" status) 'unregistered)
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
857 (t 'edited))))))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
858
94003
2ecb2ea8d5b5 Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93956
diff changeset
859 (defun vc-cvs-after-dir-status (update-function)
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
860 ;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack.
94522
a69dcc2c42ae Remove some XXX comments no longer needed.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94521
diff changeset
861 ;; This needs a lot of testing.
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
862 (let ((status nil)
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
863 (status-str nil)
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
864 (file nil)
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
865 (result nil)
93242
0dcb59446144 (vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93175
diff changeset
866 (missing nil)
98532
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
867 (ignore-next nil)
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
868 (subdir default-directory))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
869 (goto-char (point-min))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
870 (while
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
871 ;; Look for either a file entry, an unregistered file, or a
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
872 ;; directory change.
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
873 (re-search-forward
98532
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
874 "\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: \\(Examining\\|nothing\\) .*\n\\)"
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
875 nil t)
95441
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
876 ;; FIXME: get rid of narrowing here.
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
877 (narrow-to-region (match-beginning 0) (match-end 0))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
878 (goto-char (point-min))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
879 ;; The subdir
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
880 (when (looking-at "cvs status: Examining \\(.+\\)")
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
881 (setq subdir (expand-file-name (match-string 1))))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
882 ;; Unregistered files
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
883 (while (looking-at "? \\(.*\\)")
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
884 (setq file (file-relative-name
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
885 (expand-file-name (match-string 1) subdir)))
93461
3afeea9a48a3 * vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93382
diff changeset
886 (push (list file 'unregistered) result)
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
887 (forward-line 1))
98532
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
888 (when (looking-at "cvs status: nothing known about")
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
889 ;; We asked about a non existent file. The output looks like this:
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
890
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
891 ;; cvs status: nothing known about `lisp/v.diff'
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
892 ;; ===================================================================
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
893 ;; File: no file v.diff Status: Unknown
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
894 ;;
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
895 ;; Working revision: No entry for v.diff
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
896 ;; Repository revision: No revision control file
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
897 ;;
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
898
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
899 ;; Due to narrowing in this iteration we only see the "cvs
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
900 ;; status:" line, so just set a flag so that we can ignore the
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
901 ;; file in the next iteration.
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
902 (setq ignore-next t))
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
903 ;; A file entry.
95441
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
904 (when (re-search-forward "^File: \\(no file \\)?\\(.*[^ \t]\\)[ \t]+Status: \\(.*\\)" nil t)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
905 (setq missing (match-string 1))
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
906 (setq file (file-relative-name
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
907 (expand-file-name (match-string 2) subdir)))
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
908 (setq status-str (match-string 3))
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
909 (setq status
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
910 (cond
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
911 ((string-match "Up-to-date" status-str) 'up-to-date)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
912 ((string-match "Locally Modified" status-str) 'edited)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
913 ((string-match "Needs Merge" status-str) 'needs-merge)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
914 ((string-match "Needs \\(Checkout\\|Patch\\)" status-str)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
915 (if missing 'missing 'needs-update))
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
916 ((string-match "Locally Added" status-str) 'added)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
917 ((string-match "Locally Removed" status-str) 'removed)
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
918 ((string-match "File had conflicts " status-str) 'conflict)
95442
f3de1c31de14 Fix typos.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95441
diff changeset
919 ((string-match "Unknown" status-str) 'unregistered)
95441
3a41427d46d9 (vc-cvs-after-dir-status): Support spaces in file
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95425
diff changeset
920 (t 'edited)))
98532
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
921 (if ignore-next
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
922 (setq ignore-next nil)
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
923 (unless (eq status 'up-to-date)
69b1ca445635 (vc-cvs-after-dir-status): Parse the output for non
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98517
diff changeset
924 (push (list file status) result))))
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
925 (goto-char (point-max))
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
926 (widen))
95443
14f66635f87d *** empty log message ***
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95442
diff changeset
927 (funcall update-function result))
94094
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
928 ;; Alternative implementation: use the "update" command instead of
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
929 ;; the "status" command.
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
930 ;; (let ((result nil)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
931 ;; (translation '((?? . unregistered)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
932 ;; (?A . added)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
933 ;; (?C . conflict)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
934 ;; (?M . edited)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
935 ;; (?P . needs-merge)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
936 ;; (?R . removed)
94521
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94481
diff changeset
937 ;; (?U . needs-update))))
94094
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
938 ;; (goto-char (point-min))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
939 ;; (while (not (eobp))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
940 ;; (if (looking-at "^[ACMPRU?] \\(.*\\)$")
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
941 ;; (push (list (match-string 1)
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
942 ;; (cdr (assoc (char-after) translation)))
94094
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
943 ;; result)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
944 ;; (cond
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
945 ;; ((looking-at "cvs update: warning: \\(.*\\) was lost")
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
946 ;; ;; Format is:
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
947 ;; ;; cvs update: warning: FILENAME was lost
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
948 ;; ;; U FILENAME
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
949 ;; (push (list (match-string 1) 'missing) result)
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
950 ;; ;; Skip the "U" line
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
951 ;; (forward-line 1))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
952 ;; ((looking-at "cvs update: New directory `\\(.*\\)' -- ignored")
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
953 ;; (push (list (match-string 1) 'unregistered) result))))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
954 ;; (forward-line 1))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
955 ;; (funcall update-function result)))
9ec1b62752b1 (vc-cvs-after-dir-status, vc-cvs-dir-status): Add
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94045
diff changeset
956 )
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
957
98517
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
958 ;; Based on vc-cvs-dir-state-heuristic from Emacs 22.
105324
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
959 ;; FIXME does not mention unregistered files.
98517
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
960 (defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
961 "Find the CVS state of all files in DIR, using only local information."
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
962 (let (file basename status result dirlist)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
963 (with-temp-buffer
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
964 (vc-cvs-get-entries dir)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
965 (goto-char (point-min))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
966 (while (not (eobp))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
967 (if (looking-at "D/\\([^/]*\\)////")
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
968 (push (expand-file-name (match-string 1) dir) dirlist)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
969 ;; CVS-removed files are not taken under VC control.
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
970 (when (looking-at "/\\([^/]*\\)/[^/-]")
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
971 (setq basename (match-string 1)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
972 file (expand-file-name basename dir)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
973 status (or (vc-file-getprop file 'vc-state)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
974 (vc-cvs-parse-entry file t)))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
975 (unless (eq status 'up-to-date)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
976 (push (list (if basedir
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
977 (file-relative-name file basedir)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
978 basename)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
979 status) result))))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
980 (forward-line 1)))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
981 (dolist (subdir dirlist)
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
982 (setq result (append result
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
983 (vc-cvs-dir-status-heuristic subdir nil
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
984 (or basedir dir)))))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
985 (if basedir result
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
986 (funcall update-function result))))
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
987
94003
2ecb2ea8d5b5 Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93956
diff changeset
988 (defun vc-cvs-dir-status (dir update-function)
93149
5ec26b66bbe8 (vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93124
diff changeset
989 "Create a list of conses (file . state) for DIR."
98517
04d30d4471c2 (vc-cvs-dir-status-heuristic): New function.
Glenn Morris <rgm@gnu.org>
parents: 98495
diff changeset
990 ;; FIXME check all files in DIR instead?
103553
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100908
diff changeset
991 (let ((local (vc-stay-local-p dir 'CVS)))
98675
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
992 (if (and local (not (eq local 'only-file)))
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
993 (vc-cvs-dir-status-heuristic dir update-function)
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
994 (vc-cvs-command (current-buffer) 'async dir "-f" "status")
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
995 ;; Alternative implementation: use the "update" command instead of
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
996 ;; the "status" command.
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
997 ;; (vc-cvs-command (current-buffer) 'async
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
998 ;; (file-relative-name dir)
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
999 ;; "-f" "-n" "update" "-d" "-P")
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
1000 (vc-exec-after
2cae4bd13e67 * vc-hooks.el (vc-stay-local): Add a new choice and default to it.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98576
diff changeset
1001 `(vc-cvs-after-dir-status (quote ,update-function))))))
99190
e78a75586e10 (vc-cvs-stay-local): Fix typo in choice.
Martin Rudalics <rudalics@gmx.at>
parents: 99159
diff changeset
1002
98495
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1003 (defun vc-cvs-dir-status-files (dir files default-state update-function)
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1004 "Create a list of conses (file . state) for DIR."
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1005 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1006 (vc-exec-after
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1007 `(vc-cvs-after-dir-status (quote ,update-function))))
e8a025cdac4a * vc-svn.el (vc-svn-dir-status-files):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98086
diff changeset
1008
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1009 (defun vc-cvs-file-to-string (file)
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1010 "Read the content of FILE and return it as a string."
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1011 (condition-case nil
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1012 (with-temp-buffer
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1013 (insert-file-contents file)
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1014 (goto-char (point-min))
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1015 (buffer-substring (point) (point-max)))
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1016 (file-error nil)))
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1017
99159
b0dce7f34dda * vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents: 99138
diff changeset
1018 (defun vc-cvs-dir-extra-headers (dir)
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1019 "Extract and represent per-directory properties of a CVS working copy."
95042
0f15001fd142 Extract and display the CVS repository.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95020
diff changeset
1020 (let ((repo
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1021 (condition-case nil
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1022 (with-temp-buffer
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1023 (insert-file-contents "CVS/Root")
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1024 (goto-char (point-min))
95042
0f15001fd142 Extract and display the CVS repository.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95020
diff changeset
1025 (and (looking-at ":ext:") (delete-char 5))
99363
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1026 (concat (buffer-substring (point) (1- (point-max))) "\n"))
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1027 (file-error nil)))
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1028 (module
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1029 (condition-case nil
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1030 (with-temp-buffer
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1031 (insert-file-contents "CVS/Repository")
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1032 (goto-char (point-min))
99138
a479c7f4849d (vc-cvs-status-extra-headers): Use full directory name when reporting
Chong Yidong <cyd@stupidchicken.com>
parents: 98675
diff changeset
1033 (skip-chars-forward "^\n")
a479c7f4849d (vc-cvs-status-extra-headers): Use full directory name when reporting
Chong Yidong <cyd@stupidchicken.com>
parents: 98675
diff changeset
1034 (concat (buffer-substring (point-min) (point)) "\n"))
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1035 (file-error nil))))
95042
0f15001fd142 Extract and display the CVS repository.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95020
diff changeset
1036 (concat
99363
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1037 (cond (repo
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1038 (concat (propertize "Repository : " 'face 'font-lock-type-face)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1039 (propertize repo 'face 'font-lock-variable-name-face)))
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1040 (t ""))
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1041 (cond (module
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
1042 (concat (propertize "Module : " 'face 'font-lock-type-face)
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
1043 (propertize module 'face 'font-lock-variable-name-face)))
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1044 (t ""))
99363
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1045 (if (file-readable-p "CVS/Tag")
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1046 (let ((tag (vc-cvs-file-to-string "CVS/Tag")))
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1047 (cond
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1048 ((string-match "\\`T" tag)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1049 (concat (propertize "Tag : " 'face 'font-lock-type-face)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1050 (propertize (substring tag 1)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1051 'face 'font-lock-variable-name-face)))
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1052 ((string-match "\\`D" tag)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1053 (concat (propertize "Date : " 'face 'font-lock-type-face)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1054 (propertize (substring tag 1)
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1055 'face 'font-lock-variable-name-face)))
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1056 (t ""))))
e48aaf88b6e7 * vc-cvs.el (vc-cvs-dir-extra-headers): Add tag name to header.
Nick Roberts <nickrob@snap.net.nz>
parents: 99190
diff changeset
1057
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
1058 ;; In CVS, branch is a per-file property, not a per-directory property.
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
1059 ;; We can't really do this here without making dangerous assumptions.
95049
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1060 ;;(propertize "Branch: " 'face 'font-lock-type-face)
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1061 ;;(propertize "ADD CODE TO PRINT THE BRANCH NAME\n"
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1062 ;; 'face 'font-lock-warning-face)
438808a998aa Improved extra-headers method for CVS.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95043
diff changeset
1063 )))
94210
7cc87e1801a6 (vc-cvs-status-extra-headers): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94120
diff changeset
1064
50453
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1065 (defun vc-cvs-get-entries (dir)
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1066 "Insert the CVS/Entries file from below DIR into the current buffer.
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1067 This function ensures that the correct coding system is used for that,
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1068 which may not be the one that is used for the files' contents.
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1069 CVS/Entries should only be accessed through this function."
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1070 (let ((coding-system-for-read (or file-name-coding-system
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1071 default-file-name-coding-system)))
e499daf7fb22 (vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents: 50321
diff changeset
1072 (vc-insert-file (expand-file-name "CVS/Entries" dir))))
57913
f5d7d9bbc021 (vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 54465
diff changeset
1073
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1074 (defun vc-cvs-valid-symbolic-tag-name-p (tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1075 "Return non-nil if TAG is a valid symbolic tag name."
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1076 ;; According to the CVS manual, a valid symbolic tag must start with
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1077 ;; an uppercase or lowercase letter and can contain uppercase and
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1078 ;; lowercase letters, digits, `-', and `_'.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1079 (and (string-match "^[a-zA-Z]" tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1080 (not (string-match "[^a-z0-9A-Z-_]" tag))))
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1081
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
1082 (defun vc-cvs-valid-revision-number-p (tag)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
1083 "Return non-nil if TAG is a valid revision number."
44462
6eb10924e77f (vc-cvs-valid-version-number-p): New function.
Sam Steingold <sds@gnu.org>
parents: 44436
diff changeset
1084 (and (string-match "^[0-9]" tag)
6eb10924e77f (vc-cvs-valid-version-number-p): New function.
Sam Steingold <sds@gnu.org>
parents: 44436
diff changeset
1085 (not (string-match "[^0-9.]" tag))))
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1086
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1087 (defun vc-cvs-parse-sticky-tag (match-type match-tag)
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1088 "Parse and return the sticky tag as a string.
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1089 `match-data' is protected."
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1090 (let ((data (match-data))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1091 (tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1092 (type (cond ((string= match-type "D") 'date)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1093 ((string= match-type "T")
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1094 (if (vc-cvs-valid-symbolic-tag-name-p match-tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1095 'symbolic-name
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1096 'revision-number))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1097 (t nil))))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1098 (unwind-protect
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1099 (progn
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1100 (cond
46163
426c8cf1a3df Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 45255
diff changeset
1101 ;; Sticky Date tag. Convert to a proper date value (`encode-time')
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1102 ((eq type 'date)
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1103 (string-match
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1104 "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)"
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1105 match-tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1106 (let* ((year-tmp (string-to-number (match-string 1 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1107 (month (string-to-number (match-string 2 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1108 (day (string-to-number (match-string 3 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1109 (hour (string-to-number (match-string 4 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1110 (min (string-to-number (match-string 5 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1111 (sec (string-to-number (match-string 6 match-tag)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1112 ;; Years 0..68 are 2000..2068.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1113 ;; Years 69..99 are 1969..1999.
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1114 (year (+ (cond ((> 69 year-tmp) 2000)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1115 ((> 100 year-tmp) 1900)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1116 (t 0))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1117 year-tmp)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1118 (setq tag (encode-time sec min hour day month year))))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1119 ;; Sticky Tag name or revision number
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1120 ((eq type 'symbolic-name) (setq tag match-tag))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1121 ((eq type 'revision-number) (setq tag match-tag))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1122 ;; Default is no sticky tag at all
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1123 (t nil))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1124 (cond ((eq vc-cvs-sticky-tag-display nil) nil)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1125 ((eq vc-cvs-sticky-tag-display t)
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1126 (cond ((eq type 'date) (format-time-string
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1127 vc-cvs-sticky-date-format-string
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1128 tag))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1129 ((eq type 'symbolic-name) tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1130 ((eq type 'revision-number) tag)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1131 (t nil)))
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1132 ((functionp vc-cvs-sticky-tag-display)
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1133 (funcall vc-cvs-sticky-tag-display tag type))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1134 (t nil)))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1135
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1136 (set-match-data data))))
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1137
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1138 (defun vc-cvs-parse-entry (file &optional set-state)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1139 "Parse a line from CVS/Entries.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1140 Compare modification time to that of the FILE, set file properties
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1141 accordingly. However, `vc-state' is set only if optional arg SET-STATE
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1142 is non-nil."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1143 (cond
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1144 ;; entry for a "locally added" file (not yet committed)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1145 ((looking-at "/[^/]+/0/")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1146 (vc-file-setprop file 'vc-checkout-time 0)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
1147 (vc-file-setprop file 'vc-working-revision "0")
93124
97c5b398eee4 * vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93118
diff changeset
1148 (if set-state (vc-file-setprop file 'vc-state 'added)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1149 ;; normal entry
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1150 ((looking-at
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1151 (concat "/[^/]+"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1152 ;; revision
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 33554
diff changeset
1153 "/\\([^/]*\\)"
50321
17ff9d10125f (vc-cvs-parse-entry): Make sure a file with conflicts
Andreas Schwab <schwab@suse.de>
parents: 49822
diff changeset
1154 ;; timestamp and optional conflict field
17ff9d10125f (vc-cvs-parse-entry): Make sure a file with conflicts
Andreas Schwab <schwab@suse.de>
parents: 49822
diff changeset
1155 "/\\([^/]*\\)/"
43447
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1156 ;; options
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1157 "\\([^/]*\\)/"
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1158 ;; sticky tag
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1159 "\\(.\\|\\)" ;Sticky tag type (date or tag name, could be empty)
79cf46e34420 Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents: 42657
diff changeset
1160 "\\(.*\\)")) ;Sticky tag
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 84583
diff changeset
1161 (vc-file-setprop file 'vc-working-revision (match-string 1))
44104
985526b08270 (vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44005
diff changeset
1162 (vc-file-setprop file 'vc-cvs-sticky-tag
57913
f5d7d9bbc021 (vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 54465
diff changeset
1163 (vc-cvs-parse-sticky-tag (match-string 4)
52624
2b71ed49b8c6 (vc-cvs-parse-entry): Don't require parse-time, because it's
André Spiegel <spiegel@gnu.org>
parents: 52602
diff changeset
1164 (match-string 5)))
52602
04c9b596cce6 (vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents: 52401
diff changeset
1165 ;; Compare checkout time and modification time.
04c9b596cce6 (vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents: 52401
diff changeset
1166 ;; This is intentionally different from the algorithm that CVS uses
52624
2b71ed49b8c6 (vc-cvs-parse-entry): Don't require parse-time, because it's
André Spiegel <spiegel@gnu.org>
parents: 52602
diff changeset
1167 ;; (which is based on textual comparison), because there can be problems
52602
04c9b596cce6 (vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents: 52401
diff changeset
1168 ;; generating a time string that looks exactly like the one from CVS.
105324
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1169 (let* ((time (match-string 2))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1170 (mtime (nth 5 (file-attributes file)))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1171 (parsed-time (progn (require 'parse-time)
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1172 (parse-time-string (concat time " +0000")))))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1173 (cond ((and (not (string-match "\\+" time))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1174 (car parsed-time)
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1175 (equal mtime (apply 'encode-time parsed-time)))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1176 (vc-file-setprop file 'vc-checkout-time mtime)
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1177 (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1178 (t
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1179 (vc-file-setprop file 'vc-checkout-time 0)
2701a9aa1147 (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555).
Glenn Morris <rgm@gnu.org>
parents: 105010
diff changeset
1180 (if set-state (vc-file-setprop file 'vc-state 'edited))))))))
44436
f9db51bb423b (vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents: 44197
diff changeset
1181
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1182 ;; Completion of revision names.
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1183 ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1184 ;; `cvs log' so I can list all the revision numbers rather than only
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1185 ;; tag names.
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1186
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1187 (defun vc-cvs-revision-table (file)
104596
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
1188 (let (process-file-side-effects
5bce9145b1cc * vc-cvs.el (vc-cvs-state, vc-cvs-diff, vc-cvs-revision-table):
Michael Albinus <michael.albinus@gmx.de>
parents: 104262
diff changeset
1189 (default-directory (file-name-directory file))
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1190 (res nil))
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1191 (with-temp-buffer
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1192 (vc-cvs-command t nil file "log")
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1193 (goto-char (point-min))
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1194 (when (re-search-forward "^symbolic names:\n" nil t)
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1195 (while (looking-at "^ \\(.*\\): \\(.*\\)")
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1196 (push (cons (match-string 1) (match-string 2)) res)
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1197 (forward-line 1)))
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1198 (while (re-search-forward "^revision \\([0-9.]+\\)" nil t)
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1199 (push (match-string 1) res))
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1200 res)))
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1201
85458
119299b8a040 (vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85139
diff changeset
1202 (defun vc-cvs-revision-completion-table (files)
119299b8a040 (vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85139
diff changeset
1203 (lexical-let ((files files)
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1204 table)
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1205 (setq table (lazy-completion-table
85458
119299b8a040 (vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85139
diff changeset
1206 table (lambda () (vc-cvs-revision-table (car files)))))
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1207 table))
95524
75b22805a854 (vc-cvs-status-extra-headers): Remove extraneous newlines.
Sam Steingold <sds@gnu.org>
parents: 95443
diff changeset
1208
78359
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1209
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1210 (provide 'vc-cvs)
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1211
81821
0d37b602a4f0 Require CL.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81820
diff changeset
1212 ;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
31384
f6cb7dfe5e7c (vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1213 ;;; vc-cvs.el ends here