aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/vc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* VC: Use symbolic names for the working revisionSean Whitton2025-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-hg.el (vc-hg-diff): When OLDVERS is ".", behave the same as if OLDVERS was the actual working revision. (vc-hg-previous-revision): Return ".~1" for input ".", ".~3" for input ".^^" et cetera. Also, when passed non-symbolic revisions, use "REV~1" instead of "REV^" for MS-Windows compatibility. (vc-hg-working-revision-symbol): * lisp/vc/vc-git.el (vc-git-working-revision-symbol): * lisp/vc/vc-hooks.el (vc-symbolic-working-revision): New functions. (vc-default-mode-line-string): * lisp/vc/ediff-vers.el (ediff-vc-merge-internal): * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): * lisp/vc/vc.el (vc-diff-build-argument-list-internal) (vc-diff-outgoing, vc-revision-other-window, vc-default-revert): Call vc-symbolic-working-revision. (vc-buffer-revision): Specify that this should always be a revision number/hash, not a symbolic name. * lisp/vc/vc-git.el (vc-git-previous-revision): Return "HEAD~1" for input "HEAD", "HEAD~3" for input "HEAD^^" et cetera.
* vc-add-working-tree: Finish by starting DiredSean Whitton2025-10-011-9/+5
| | | | | | | | | | There won't be any uncommitted changes in the new working tree yet, so vc-dir is unlikely to be useful. * lisp/vc/vc.el (vc-add-working-tree): Finish by calling 'dired' not 'vc-dir'. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): Delete stubbing out 'vc-dir'.
* vc-test--checkin-patch: Use atomic change groupsSean Whitton2025-09-301-19/+20
| | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--with-temp-change): New macro. (vc-test--checkin-patch): Use it.
* vc-test--checkin-patch: Restore alternative revert code pathSean Whitton2025-09-271-1/+9
| | | | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): For the last stage of the test, restore alternative code path for Git, though this time limited to when running the test on MS-Windows. Cf. subthread starting from <https://lists.gnu.org/archive/html/emacs-devel/2025-09/msg00785.html>.
* vc-test--checkin-patch: Use {author} not {user}Sean Whitton2025-09-261-1/+1
| | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): Use Mercurial template '{author}' not '{user}' for compatibility.
* vc-git--checkin: Apply PATCH-STRING to working treeSean Whitton2025-09-241-9/+1
| | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--with-apply-temp-to-staging): Rename ... (vc-git--with-apply-temp): ... to this. New ARGS parameter. All uses changes. (vc-git--checkin): In POST function, apply PATCH-STRING to the working tree with 'git apply --3way --ours'. * lisp/vc/vc-hg.el (vc-hg--checkin): Document what the call to 'hg update' is for. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): Delete completed FIXME and workaround.
* VC checkin-patch: Support extracting commit metadata from patchesSean Whitton2025-09-211-1/+128
| | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--mailinfo): New function. (vc-git-checkin-patch): Use it to extract authorship, date and log message information from patches. (vc-git--call): New INFILE argument. All uses changed. * lisp/vc/vc-hg.el (vc-hg--checkin): When COMMENT is nil, take authorship, date and log message information from the patch. * lisp/vc/vc.el (checkin-patch): Specify to use authorship, date and comment information in PATCH-STRING (bug#79408). (prepare-patch): Specify that patch should include authorship identity, date and log message information for REV if supported. (diff-bounds-of-hunk): Declare. (vc-default-checkin-patch): Warn if it looks like we will ignore patch authorship information. * test/lisp/vc/vc-tests/vc-tests.el (vc-hg-command) (vc-git--out-str): Declare. (vc-test--checkin-patch): New function. (vc-test-git08-checkin-patch, vc-test-hg08-checkin-patch): New tests.
* Rename arg REMOTE-LOCATION -> UPSTREAM-LOCATIONSean Whitton2025-09-011-2/+2
| | | | | | | | | | | | | | | | * lisp/vc/vc-bzr.el (vc-bzr-log-incoming) (vc-bzr-incoming-revision, vc-bzr-log-outgoing): * lisp/vc/vc-git.el (vc-git-incoming-revision): * lisp/vc/vc-hg.el (vc-hg-incoming-revision): * lisp/vc/vc.el (vc-root-diff-incoming, vc-diff-incoming) (vc-root-diff-outgoing, vc-diff-outgoing) (vc-root-diff-outgoing-base, vc-diff-outgoing-base) (vc-incoming-outgoing-internal, vc-remote-location-history) (vc--incoming-revision, vc-log-incoming, vc-default-log-incoming) (vc-log-outgoing, vc-default-log-outgoing): Rename arguments REMOTE-LOCATION -> UPSTREAM-LOCATION. Adjust strings. (vc--maybe-read-remote-location): Rename ... (vc--maybe-read-upstream-location): ... to this.
* vc-test--with-author-identity: Handle MercurialSean Whitton2025-08-161-3/+9
| | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-hg-global-switches): Declare. (vc-test--with-author-identity): Handle Mercurial.
* vc-test--other-working-trees: Export env vars so Git finds an authorSean Whitton2025-08-121-158/+164
| | | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--with-author-identity): New macro, factored out of vc-test--version-diff. (vc-test--version-diff, vc-test--other-working-trees): Use it.
* vc-test--other-working-trees: Fix a skip conditionSean Whitton2025-08-121-16/+16
| | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): For Git, don't try moving the first working tree unless we have Git>=2.29.
* vc-test-git07-other-working-trees: Widen scope of skip on Git<=2.17Sean Whitton2025-08-121-27/+28
| | | | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): Delete condition to skip 'move-working-tree' tests on Git<=2.17. (vc-test-git07-other-working-trees): Skip this whole test on Git<=2.17 (discussion in bug#79024).
* Fix some 'git worktree' compatibility issuesSean Whitton2025-08-101-26/+31
| | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git-delete-working-tree): Reimplement to avoid requiring 'git worktree remove'. (vc-git-move-working-tree): Use 'git worktree move' if 'git worktree repair' is not available. Give a more informative error message if we don't even have that. * test/lisp/vc/vc-tests/vc-tests.el (vc-git--program-version): Declare. (vc-test--other-working-trees): Skip vc-move-working-tree tests with Git old enough to lack 'git worktree move'.
* Fix vc-git worktrees and vc-tests for directories with symlinksMattias Engdegård2025-08-041-6/+9
| | | | | | | * lisp/vc/vc-git.el (vc-git-known-other-working-trees): * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): Tolerate directories with symlinks in them, such as the standard temporary dirs on MacOS. 'git worktree list' outputs expanded names.
* vc-test--other-working-trees: Stub out 'vc-dir'Sean Whitton2025-07-271-5/+9
| | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): Stub out 'vc-dir' when adding the second working tree.
* vc-tests: Fix two problems with other working tree testsSean Whitton2025-07-271-4/+12
| | | | | | | | * test/lisp/vc/vc-tests/vc-tests.el (project, cl-lib): Require. (vc-test--other-working-trees): Bind project-list-file to a writeable file name. (vc-test-hg07-other-working-trees): Use vc-hg-global-switches to enable the share extension.
* ; vc-test--other-working-trees: Fix unused variable warning.Sean Whitton2025-07-261-1/+1
|
* VC: New support for other working treesSean Whitton2025-07-251-1/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--read-start-point): New function, factored out of vc-git-create-tag. (vc-git-create-tag): Use it. (vc-git--worktrees, vc-git-known-other-working-trees) (vc-git-add-working-tree, vc-git-delete-working-tree) (vc-git-move-working-tree): * lisp/vc/vc-hg.el (vc-hg-known-other-working-trees) (vc-hg-add-working-tree, vc-hg--shared-p) (vc-hg-delete-working-tree, vc-hg-move-working-tree): New functions. * lisp/vc/vc.el: Define API for known-other-working-tree, add-working-tree, delete-working-tree and move-working-tree backend functions. (vc-dir-status-files): New function. (project-current-directory-override): Declare. (dired-rename-subdir): Autoload. (vc-add-working-tree, vc-switch-working-tree) (vc-delete-working-tree, vc-move-working-tree): New commands. * lisp/vc/vc-hooks.el (vc-prefix-map): Bind them under C-x v. * doc/emacs/vc1-xtra.texi (Other Working Trees): New node. * etc/NEWS: Announce the new commands. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): New function. (vc-test-git07-other-working-trees) (vc-test-hg07-other-working-trees): New tests. * lisp/ldefs-boot.el: Regenerate.
* vc-test--version-diff: Bind vc-async-checkinSean Whitton2025-07-251-1/+2
| | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff): Bind vc-async-checkin to disable async checkins during test.
* ; * test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff): Fix for Bzr.Eli Zaretskii2025-07-151-0/+2
|
* VC: Deprecate log-incoming and log-outgoing backend functionsSean Whitton2025-06-061-2/+2
| | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git-incoming-revision): Inline vc-git--fetch-incoming. (vc-git--fetch-incoming, vc-git-log-incoming) (vc-git-log-outgoing): Delete. * lisp/vc/vc-hg.el (vc-hg-mergebase): * lisp/vc/vc.el (vc-default-log-incoming) (vc-default-log-outgoing): New functions. * lisp/vc/vc.el: * etc/NEWS: Document the deprecation.
* ; Fix VC testsEli Zaretskii2025-05-092-1/+6
| | | | | | | | | * test/lisp/vc/vc-tests/vc-tests.el (vc-test-hg06-version-diff): Skip on MS-Windows in batch mode. * test/lisp/vc/vc-git-tests.el (vc-git-test--start-branch): More portable command for showing the current branch ("--show-current" is only available since Git 2.22).
* Create new test/lisp/vc/vc-tests/ for vc.el testsSean Whitton2025-05-092-3/+3
| | | | | | | * test/lisp/vc/vc-tests.el: Move ... * test/lisp/vc/vc-tests/vc-tests.el: ... to here. * test/lisp/vc/vc-misc-tests.el: Move ... * test/lisp/vc/vc-tests/vc-test-misc.el: ... to here.
* Improve syncing VC buffers before generating diffsSean Whitton2025-04-271-0/+67
| | | | | | | | | | | | | | | * lisp/vc/vc.el (vc-maybe-buffer-sync): Delete. Correct handling of indirect buffers is now implicitly achieved by vc-buffer-sync-fileset. (vc-buffer-sync-fileset): Make NOT-ESSENTIAL argument optional, new MISSING-IN-DIRS optional argument. Rewrite to handle directories named in the fileset, not only files. (vc-ediff): Replace call to vc-maybe-buffer-sync with a call to vc-buffer-sync-fileset. (vc-root-diff): Similarly replace call to vc-maybe-buffer-sync. This means the user is prompted to save additional buffers, that they likely want to save before generating the diffs. * test/lisp/vc/vc-misc-tests.el: New file.
* Fix emerge.el for remote filesMichael Albinus2025-04-201-0/+81
| | | | | | | | * lisp/vc/emerge.el (emerge-make-diff-list) (emerge-make-diff3-list): Set proper `default-directory' in order to support remote files. (Bug#6850, Bug#74352) * test/lisp/vc/emerge-tests.el: New file.
* ; Fix failing diff-mode testsStefan Kangas2025-04-192-85/+85
| | | | | | | | | | | * test/lisp/vc/diff-mode-resources/git.patch: Delete file, moving its contents to... * test/lisp/vc/diff-mode-tests.el (diff-mode-tests--git-patch): ...this new variable. Git merges kept deleting a trailing whitespace in the patch signature, so let's do this instead. (diff-mode-test-git-patch) (diff-mode-test-git-patch/before-first-hunk) (diff-mode-test-git-patch/signature): Use above new variable.
* Merge from savannah/emacs-30Yuan Fu2025-04-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | 01d4eb3dd42 ; Improve doc string of 'insert-char' 93ad8407ed8 * admin/notes/emba: Fix docker build instruction. b901290ae7f * doc/lispref/text.texi (Margins): Grammar fix. 16855c89dde Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... 8792d3431b1 Backport: Fix tree-sitter tests on Emba # Conflicts: # test/infra/Dockerfile.emba
* | ; Drop Mtn from comment now vc-mtn is obsoleteSean Whitton2025-04-081-1/+1
| |
* | Teach diff-apply-hunk to handle hunks with empty contextTomas Nordin2025-03-151-0/+96
| | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-find-source-location): Consider the case when there is no diff context above or below edited lines. (bug#72556) * test/lisp/vc/diff-mode-tests.el: Add tests for undoing hunks from diffs with addtions only in the beginning or end of the source file.
* | ; Fix 'diff-mode' tests (Bug#77014)john muhl2025-03-141-1/+1
| | | | | | | | * test/lisp/vc/diff-mode-resources/git.patch: Restore missing space.
* | Merge from origin/emacs-30Yuan Fu2025-03-131-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | defc55bb6f9 Fix treesit-parser-create behavior regarding indirect buf... 20ac26e6751 ; Fix with-delayed-message docstring metavars. 04034cd9ce7 Fix 'dired-movement-style' in Dired when subdirs are shown f8443dffc1f ; * lisp/register.el (register-use-preview): Doc fix (bug... f729828bcfb ; Add texinfo reference to GNU Coding Standards. a6abb88fdcc ; * lisp/files.el (executable-find): Doc fix. # Conflicts: # src/treesit.c
| * Update copyright year to 2025Stefan Kangas2025-01-0211-11/+11
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | ; Fix byte-compiler warningStefan Kangas2025-03-091-1/+1
| |
* | Guard against user saving ediff-meta-diff-bufferMauro Aranda2025-03-091-0/+54
| | | | | | | | | | | | | | * lisp/vc/ediff-mult.el (ediff-collect-custom-diffs): If the diff buffer is visiting a file, create a new buffer. (Bug#3348) * test/lisp/vc/ediff-mult-tests.el: New test file.
* | VC: New hook to strip CVS template lines when committingChristoph Badura2025-03-091-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a hook function to strip all lines beginning with "CVS:" from the commit message as CVS does. Do this only if 'log-edit-vc-backend' is 'CVS'. (Bug#72341) * lisp/vc/log-edit.el (log-edit-done-strip-cvs-lines): New command. (log-edit-done-hook): Add it as an option. * test/lisp/vc/log-edit-tests.el (log-edit-done-strip-cvs-lines-helper): New function. (log-edit-done-strip-cvs-lines-cvs) (log-edit-done-strip-cvs-lines-non-cvs) (log-edit-done-strip-cvs-lines-only-cvs-colon-blank) (log-edit-done-strip-cvs-lines-only-cvs-colon): New test cases. * etc/NEWS: Mention log-edit-done-strip-cvs-lines.
* | Fix fontification outside hunks in Git patchesStefan Kangas2025-03-032-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-font-lock-keywords): Don't fontify lines in Git patches starting with + or - as added/removed, if they are either before the first hunk, or in the email signature. (Bug#75884) (diff-buffer-type): Move definition up. (diff--indicator-added-re, diff--indicator-removed-re): New variables. (diff--git-preamble-end, diff--git-footer-start) (diff--indicator-matcher-helper, diff--indicator-added-matcher) (diff--indicator-removed-matcher): New functions. * test/lisp/vc/diff-mode-tests.el (diff-mode-test-git-patch) (diff-mode-test-git-patch/before-first-hunk) (diff-mode-test-git-patch/signature): New tests. * test/lisp/vc/diff-mode-resources/git.patch: New file.
* | ; Fix thinkoStefan Kangas2025-03-021-3/+3
| |
* | Fix a vc test for Breezy by setting $HOMEStefan Kangas2025-03-021-25/+13
| | | | | | | | | | | | | | | | * test/lisp/vc/vc-tests.el (vc--fix-home-for-bzr): New macro. (vc-test--create-repo, vc-test--register, vc-test--working-revision) (vc-test--checkout-model, vc-test--rename-file) (vc-test--version-diff): Fix test for Breezy by setting HOME to a temporary directory. (Bug#70195)
* | Test vc-git-dir-extra-headers directly (bug#76187)Kévin Le Gouguec2025-02-171-59/+63
| | | | | | | | | | | | | | | | | | | | * test/lisp/vc/vc-git-tests.el (vc-git-test--run): Make sure to log output from failing Git commands. (vc-git-test--dir-headers): Stop bothering with vc-dir internals and just invoke the branch-munging and header-formatting code we mean to test. (vc-git-test-dir-branch-headers): Stop invoking vc-dir; just set default-directory to be able to pass it to the backend function.
* | (diff-mode-test-font-lock): Fix spurious test failureStefan Monnier2025-02-151-19/+19
| | | | | | | | | | * test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock): Don't nitpick about non-face-affecting overlays.
* | Update copyright year to 2025Paul Eggert2025-01-0111-11/+11
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Test more vc-dir scenarios with Git (bug#68183)Kévin Le Gouguec2024-08-211-18/+80
|/ | | | | | | | | | | | * test/lisp/vc/vc-git-tests.el (vc-git-test-dir-track-local-branch): Remove in favor of new test. (vc-git-test--start-branch): New helper to get a repository going. (vc-git-test--dir-headers): New helper to get a list of headers in the current vc-dir buffer. (vc-git-test-dir-branch-headers): New test, exercising the original bug recipe plus more common scenarios.
* Replace literal whitespace with `\s`Stefan Kangas2024-06-221-5/+3
| | | | | | | * test/lisp/vc/log-edit-tests.el (log-edit-fill-entry-confinement) (log-edit-fill-entry-space-substitution) (log-edit-fill-entry-initial-wrapping): Replace literal space character with '\s', to avoid tripping up merge scripts.
* More effectually prevent defun list wrapping in C-x C-wPo Lu2024-04-241-0/+18
| | | | | | | | * lisp/vc/log-edit.el (log-edit-fill-entry): Match and replace with NBSPs the opening defun list also. * test/lisp/vc/log-edit-tests.el (log-edit-fill-entry-no-defun-list-wrapping): New test.
* ; * test/lisp/vc/vc-git-tests.el: bend doc string quoteMattias Engdegård2024-03-291-1/+1
|
* Fix vc-git test when no identities are configuredKévin Le Gouguec2024-03-191-2/+9
| | | | | | | | Reported by john muhl <jm@pub.pink>. * test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Set some environment variables (lifted from vc-tests.el) to let 'git commit' compute dummy author and committer identities.
* ; Re-apply accidentally reverted commitKévin Le Gouguec2024-03-171-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-applies: 2024-03-17 "Fix vc-dir when "remote" Git branch is local" (21828f288ef) reverted as part of the unrelated: 2024-03-17 "Update modus-themes to their 4.4.0 version" (67b0c1c09ea) The original commit message follows: Fix vc-dir when "remote" Git branch is local While in there, add that "tracking" branch to the vc-dir buffer. For bug#68183. * lisp/vc/vc-git.el (vc-git-dir-extra-headers): Reduce boilerplate with new function 'vc-git--out-ok'; stop calling vc-git-repository-url when REMOTE is "." to avoid throwing an error; display tracking branch; prefer "none (<details...>)" to "not (<details...>)" since that reads more grammatically correct. (vc-git--out-ok): Add documentation. (vc-git--out-str): New function to easily get the output from a Git command. * test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo) (vc-git-test--run): New helpers, defined to steer clear of vc-git-- internal functions. (vc-git-test-dir-track-local-branch): Check that vc-dir does not crash.
* Update modus-themes to their 4.4.0 versionProtesilaos Stavrou2024-03-171-40/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/modus-themes.org: Update the manual to better document existing functionality and cover the new features. * etc/themes/modus-operandi-deuteranopia-theme.el: * etc/themes/modus-operandi-theme.el: * etc/themes/modus-operandi-tinted-theme.el: * etc/themes/modus-operandi-tritanopia-theme.el: * etc/themes/modus-vivendi-deuteranopia-theme.el: * etc/themes/modus-vivendi-theme.el: * etc/themes/modus-vivendi-tinted-theme.el: * etc/themes/modus-vivendi-tritanopia-theme.el: Update the palette of each theme. * etc/themes/modus-themes.el (require): Remove call to cl-lib and do not use relevant functions. (modus-themes-operandi-colors, modus-themes-vivendi-colors) (modus-themes-version, modus-themes-report-bug): Remove old calls to 'make-obsolete' and related. (modus-themes--annotate-theme): Tweak the completion annotation function. (modus-themes--org-block): Deprecate the user option 'modus-themes-org-blocks'. (modus-themes-faces): Update faces. (modus-themes-custom-variables): Update the list of custom variables. Detailed release notes are available here: <https://protesilaos.com/codelog/2024-03-17-modus-themes-4-4-0/>.
* Fix vc-dir when "remote" Git branch is localKévin Le Gouguec2024-03-171-0/+40
| | | | | | | | | | | | | | | | | | | | While in there, add that "tracking" branch to the vc-dir buffer. For bug#68183. * lisp/vc/vc-git.el (vc-git-dir-extra-headers): Reduce boilerplate with new function 'vc-git--out-ok'; stop calling vc-git-repository-url when REMOTE is "." to avoid throwing an error; display tracking branch; prefer "none (<details...>)" to "not (<details...>)" since that reads more grammatically correct. (vc-git--out-ok): Add documentation. (vc-git--out-str): New function to easily get the output from a Git command. * test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo) (vc-git-test--run): New helpers, defined to steer clear of vc-git-- internal functions. (vc-git-test-dir-track-local-branch): Check that vc-dir does not crash.
* Don't open a new line for long defuns being inserted at column 0Po Lu2024-01-291-16/+25
| | | | | | | | | | * lisp/vc/log-edit.el (log-edit--insert-filled-defuns): Don't open a new line for long defuns at column 0. * test/lisp/vc/log-edit-tests.el (log-edit-fill-entry-space-substitution): Adjust expected results to match change. (log-edit-fill-entry-initial-wrapping): New test.