1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-14 10:00:25 -08:00
Commit graph

26 commits

Author SHA1 Message Date
Mattias Engdegård
e443811bd7 ; * test/lisp/vc/vc-tests/vc-tests.el: use write-region, again 2025-10-20 16:25:55 +02:00
Sean Whitton
095956a745 vc-test--with-temp-change: Use write-region
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--with-temp-change):
Use write-region (bug#79657).
2025-10-20 15:16:05 +01:00
Sean Whitton
b0012cb8e1 vc-rename-file: Make it work regardless of default-directory
* lisp/vc/vc.el (vc-rename-file): Make it work regardless of
default-directory; now the only influence of default-directory
should be resolving OLD and NEW if they are relative file names.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file): Test
the influence of default-directory on vc-rename-file.
2025-10-19 15:39:22 +01:00
Sean Whitton
d3c4679acd VC: Use symbolic names for the working revision
* 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.
2025-10-05 15:27:07 +01:00
Sean Whitton
c24e173c9c vc-add-working-tree: Finish by starting Dired
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'.
2025-10-01 11:26:18 +01:00
Sean Whitton
8453fd59d4 vc-test--checkin-patch: Use atomic change groups
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--with-temp-change):
New macro.
(vc-test--checkin-patch): Use it.
2025-09-30 16:15:44 +01:00
Sean Whitton
1d03eb590c vc-test--checkin-patch: Restore alternative revert code path
* 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>.
2025-09-27 21:31:38 +01:00
Sean Whitton
398b4f96ce vc-test--checkin-patch: Use {author} not {user}
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
Use Mercurial template '{author}' not '{user}' for
compatibility.
2025-09-26 15:10:13 +01:00
Sean Whitton
8368fcb38c vc-git--checkin: Apply PATCH-STRING to working tree
* 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.
2025-09-24 16:07:51 +01:00
Sean Whitton
8310795bab VC checkin-patch: Support extracting commit metadata from patches
* 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.
2025-09-21 21:59:02 +01:00
Sean Whitton
66ef930ebe Rename arg REMOTE-LOCATION -> UPSTREAM-LOCATION
* 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.
2025-09-01 09:41:40 +01:00
Sean Whitton
d4c9f08f26 vc-test--with-author-identity: Handle Mercurial
* test/lisp/vc/vc-tests/vc-tests.el (vc-hg-global-switches):
Declare.
(vc-test--with-author-identity): Handle Mercurial.
2025-08-16 14:12:04 +01:00
Sean Whitton
bb1c737531 vc-test--other-working-trees: Export env vars so Git finds an author
* 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.
2025-08-12 20:35:49 +01:00
Sean Whitton
2923d244a3 vc-test--other-working-trees: Fix a skip condition
* 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.
2025-08-12 14:36:15 +01:00
Sean Whitton
c687756ce2 vc-test-git07-other-working-trees: Widen scope of skip on Git<=2.17
* 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).
2025-08-12 14:11:13 +01:00
Sean Whitton
66eead6fd0 Fix some 'git worktree' compatibility issues
* 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'.
2025-08-10 13:25:41 +01:00
Mattias Engdegård
1811cb294e Fix vc-git worktrees and vc-tests for directories with symlinks
* 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.
2025-08-04 10:55:25 +01:00
Sean Whitton
e954b29f5f vc-test--other-working-trees: Stub out 'vc-dir'
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--other-working-trees): Stub out 'vc-dir' when adding
the second working tree.
2025-07-27 19:44:31 +01:00
Sean Whitton
eadc36a2af vc-tests: Fix two problems with other working tree tests
* 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.
2025-07-27 09:24:02 +01:00
Sean Whitton
ed71aac7ea ; vc-test--other-working-trees: Fix unused variable warning. 2025-07-26 13:13:29 +01:00
Sean Whitton
50ffb29d0b VC: New support for other working trees
* 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.
2025-07-25 19:34:04 +01:00
Sean Whitton
08ca6caa0a vc-test--version-diff: Bind vc-async-checkin
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff):
Bind vc-async-checkin to disable async checkins during test.
2025-07-25 19:04:07 +01:00
Eli Zaretskii
0237e0d1a4 ; * test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff): Fix for Bzr. 2025-07-15 19:30:05 +03:00
Sean Whitton
ac4869c712 VC: Deprecate log-incoming and log-outgoing backend functions
* 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.
2025-06-06 09:53:32 +01:00
Eli Zaretskii
b87608c9c7 ; Fix VC tests
* 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).
2025-05-09 14:43:03 +03:00
Sean Whitton
295c38b03d Create new test/lisp/vc/vc-tests/ for vc.el tests
* 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.
2025-05-09 11:00:47 +01:00