D9081: git: add test showing `hg commit -i` working on a git repo
sheehan (Connor Sheehan)
phabricator at mercurial-scm.org
Thu Sep 24 16:37:49 UTC 2020
sheehan created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
Shows `hg commit -i` working on a git repo via the `git`
extension. Adds working directory changes to files `alpha` and
`beta`, then selects only `alpha` changes and commits them.
As of now this would fail for a filename that
includes uppercase characters due to the lack of case folding
support in the extension.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D9081
AFFECTED FILES
tests/test-git-interop.t
CHANGE DETAILS
diff --git a/tests/test-git-interop.t b/tests/test-git-interop.t
--- a/tests/test-git-interop.t
+++ b/tests/test-git-interop.t
@@ -272,6 +272,87 @@
+beta
+Interactive commit should work as expected
+
+ $ echo bar >> alpha
+ $ echo bar >> beta
+ $ hg commit -m "test interactive commit" -i --config ui.interactive=true --config ui.interface=text << EOF
+ > y
+ > y
+ > n
+ > EOF
+ diff --git a/alpha b/alpha
+ 1 hunks, 1 lines changed
+ examine changes to 'alpha'?
+ (enter ? for help) [Ynesfdaq?] y
+
+ @@ -1,3 +1,4 @@
+ alpha
+ a
+ a
+ +bar
+ record change 1/2 to 'alpha'?
+ (enter ? for help) [Ynesfdaq?] y
+
+ diff --git a/beta b/beta
+ 1 hunks, 1 lines changed
+ examine changes to 'beta'?
+ (enter ? for help) [Ynesfdaq?] n
+
+Status should be consistent for both systems
+
+ $ hg status
+ heads mismatch, rebuilding dagcache
+ M beta
+ $ git status
+ On branch master
+ Changes not staged for commit:
+ (use "git add <file>..." to update what will be committed)
+ (use "git checkout -- <file>..." to discard changes in working directory)
+
+ modified: beta
+
+ no changes added to commit (use "git add" and/or "git commit -a")
+
+Contents of each commit should be the same
+
+ $ hg ex -r .
+ # HG changeset patch
+ # User test <test>
+ # Date 0 0
+ # Thu Jan 01 00:00:00 1970 +0000
+ # Node ID 80adc61cf57e99f6a412d83fee6239d1556cefcf
+ # Parent ae1ab744f95bfd5b07cf573baef98a778058537b
+ test interactive commit
+
+ diff -r ae1ab744f95b -r 80adc61cf57e alpha
+ --- a/alpha Thu Jan 01 00:00:00 1970 +0000
+ +++ b/alpha Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,3 +1,4 @@
+ alpha
+ a
+ a
+ +bar
+ $ git show
+ commit 80adc61cf57e99f6a412d83fee6239d1556cefcf
+ Author: test <test>
+ Date: Thu Jan 1 00:00:00 1970 +0000
+
+ test interactive commit
+
+ diff --git a/alpha b/alpha
+ index d112a75..d2a2e9a 100644
+ --- a/alpha
+ +++ b/alpha
+ @@ -1,3 +1,4 @@
+ alpha
+ a
+ a
+ +bar
+
Deleting files should also work (this was issue6398)
+ $ hg revert -r . --all
+ reverting beta
$ hg rm beta
$ hg ci -m 'remove beta'
+
To: sheehan, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list