mercurial@41767: 41 new changesets
41 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/e1643a0455c8 changeset: 41727:e1643a0455c8 parent: 41724:35158796f52f user:Jordi Gutiérrez Hermoso date:Mon Feb 18 18:44:21 2019 -0500 summary: test-sqlitestore: run sqlite3 with no init file https://www.mercurial-scm.org/repo/hg/rev/36b62a522814 changeset: 41728:36b62a522814 user:Jordi Gutiérrez Hermoso date:Mon Feb 18 23:43:40 2019 -0500 summary: templatekw: make negrev return empty for wdir() and nullrev https://www.mercurial-scm.org/repo/hg/rev/4d5f48782921 changeset: 41729:4d5f48782921 user:Jordi Gutiérrez Hermoso date:Fri Feb 15 14:56:07 2019 -0500 summary: chistedit: ensure a locale is set https://www.mercurial-scm.org/repo/hg/rev/19d8d6856338 changeset: 41730:19d8d6856338 user:Matt Harbison date:Sat Feb 16 21:49:55 2019 -0500 summary: tests: glob over quoting differences in test-blackbox.t for Windows https://www.mercurial-scm.org/repo/hg/rev/92055d539e49 changeset: 41731:92055d539e49 user:Matt Harbison date:Sat Feb 16 22:03:58 2019 -0500 summary: tests: conditionalize msys path mangling in test-bundle.t https://www.mercurial-scm.org/repo/hg/rev/9d39671adadb changeset: 41732:9d39671adadb user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: use NO_CHECK_EOF as heredoc limit mark to omit checking code fragments https://www.mercurial-scm.org/repo/hg/rev/d7ce1ea7a5f2 changeset: 41733:d7ce1ea7a5f2 user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: define class in modern style to avoid check-code.py error https://www.mercurial-scm.org/repo/hg/rev/6462bbb91b53 changeset: 41734:6462bbb91b53 user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: bulk change to avoid "unneeded trailing ',' ..." error of check-code.py https://www.mercurial-scm.org/repo/hg/rev/67333663d49e changeset: 41735:67333663d49e user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: replace imported module to avoid check-code.py error https://www.mercurial-scm.org/repo/hg/rev/9897e95b0b4a changeset: 41736:9897e95b0b4a user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: bulk changes to avoid "omit superfluous pass" check-code.py error https://www.mercurial-scm.org/repo/hg/rev/cab32f08c994 changeset: 41737:cab32f08c994 user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: replace "naked except clause" to avoid check-code.py error https://www.mercurial-scm.org/repo/hg/rev/c70bdd222dcd changeset: 41738:c70bdd222dcd user:FUJIWARA Katsunori date:Mon Feb 18 00:27:25 2019 +0900 summary: tests: bulk changes to avoid whitespace errors of check-code.py https://www.mercurial-scm.org/repo/hg/rev/8ab42ccb68fe changeset: 41739:8ab42ccb68fe user:Jordi Gutiérrez Hermoso date:Fri Feb 15 15:24:04 2019 -0500 summary: grep: give different labels to + and - symbols https://www.mercurial-scm.org/repo/hg/rev/ee77a6dd8fb8 changeset: 41740:ee77a6dd8fb8 user:Jordi Gutiérrez Hermoso date:Fri Feb 15 15:43:22 2019 -0500 summary: color: give colours to the grep.inserted and grep.deleted labels https://www.mercurial-scm.org/repo/hg/rev/a91615b71679 changeset: 41741:a91615b71679 user:Jordi Gutiérrez Hermoso date:Fri Feb 15 15:49:17 2019 -0500 summary: color: change color of grep.rev label (BC) https://www.mercurial-scm.org/repo/hg/rev/3d5a73c8a417 changeset: 41742:3d5a73c8a417 parent: 41741:a91615b71679 parent: 41725:ffbf742bfe1f user:Martin von Zweigbergk date:Tue Feb 19 21:55:05 2019 -0800 summary: merge with stable https://www.mercurial-scm.org/repo/hg/rev/1c4d6ab2ecb8 changeset: 41743:1c4d6ab2ecb8 user:Boris Feld date:Thu Feb 14 14:36:16 2019 +0100 summary: test: stabilize test-remotefilelog-bgprefetch.t flaky output https://www.mercurial-scm.org/repo/hg/rev/0ae89ab3f025 changeset: 41744:0ae89ab3f025 user:Boris Feld date:Thu Feb 14 15:35:47 2019 +0100 summary: test: stabilize test-run-tests.t output https://www.mercurial-scm.org/repo/hg/rev/83d294c71f1e changeset: 41745:83d294c71f1e user:Martin von Zweigbergk date:Fri Feb 15 10:49:12 2019 -0800 summary: uncommit: inform user if the commit is empty after uncommit https://www.mercurial-scm.org/repo/hg/rev/2dcb637aaf10 changeset: 41746:2dcb637aaf10 user:Pulkit Goyal date:Mon Feb 18 03:39:47 2019 +0530 summary: py3: whitelist 5 new passing tests caught by buildbot https://www.mercurial-scm.org/repo/hg/rev/31b84c72ada0 changeset: 41747:31b84c72ada0 user:Martin von Zweigbergk date:Sun Feb 17 09:05:28 2019
[Bug 6089] New: `hg pick` doesn’t update branch of working directory
https://bz.mercurial-scm.org/show_bug.cgi?id=6089 Bug ID: 6089 Summary: `hg pick` doesn’t update branch of working directory Product: Mercurial Version: unspecified Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: evolution Assignee: bugzi...@mercurial-scm.org Reporter: m...@manueljacob.de CC: mercurial-devel@mercurial-scm.org, pierre-yves.da...@ens-lyon.org Steps to reproduce: hg init touch test1 hg add test1 hg ci -m 'first commit on default' hg branch foo touch test2 hg add test2 hg ci -m 'first commit on foo' hg up default echo test > test1 hg ci -m 'second commit on default' hg grab 1 hg log --template '{branch}\n' -r tip hg branch Expected behavior: The branch of the working directory is `foo`, the same as the branch of the new changeset. This would be consistent with the description of the command in the help: "move a commit on the top of working directory parent and updates to it". Actual behavior: The branch of the working directory is `default`. Analysis: The implementation of the `hg pick` command, function `cmdpick` in `hgext3rd/evolve/cmdrewrite.py`, passes the `extra` dictionary of the original changeset to `repo.commit()`. However, it doesn’t update the branch of the working directory. -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6007: diff: make sure we output stat info even when --git is not passed (issue4037)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Before this patch, `hg diff --stat` will give an empty output. It will not show the stat information. I debugged and found that the underlying code does not return the diff header and due to that, other code paths fails to parse that as a diff. I looked into why we don't return diff headers in quiet mode and found the behavior is from https://phab.mercurial-scm.org/rHG8f8bb77d560e70bcc95577e4dfa877df18d876ab which does not have any mention about why it is done. We also show the diff headers in git, so I think it's fine showing diff header in normal diff in quiet mode. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6007 AFFECTED FILES mercurial/patch.py tests/test-commit.t tests/test-diff-hashes.t tests/test-diffstat.t tests/test-mq.t tests/test-transplant.t CHANGE DETAILS diff --git a/tests/test-transplant.t b/tests/test-transplant.t --- a/tests/test-transplant.t +++ b/tests/test-transplant.t @@ -599,6 +599,7 @@ > EOF 0:17ab29e464c6 apply changeset? [ynmpcq?]: p + diff -r -r 17ab29e464c6 r1 --- /dev/nullThu Jan 01 00:00:00 1970 + +++ b/r1 Thu Jan 01 00:00:00 1970 + @@ -0,0 +1,1 @@ diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -305,6 +305,7 @@ working dir diff: $ hg diff --nodates -q + diff -r dde259bd5934 a --- a/a +++ b/a @@ -1,1 +1,2 @@ diff --git a/tests/test-diffstat.t b/tests/test-diffstat.t --- a/tests/test-diffstat.t +++ b/tests/test-diffstat.t @@ -289,3 +289,6 @@ A new c R c $ hg diff --stat -q + c | 1 - + new c | 1 + + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/test-diff-hashes.t b/tests/test-diff-hashes.t --- a/tests/test-diff-hashes.t +++ b/tests/test-diff-hashes.t @@ -13,6 +13,7 @@ $ hg ci -m 'change foo' $ hg --quiet diff -r 0 -r 1 + diff -r a99fb63adac3 -r 9b8568d3af2f foo --- a/fooThu Jan 01 00:00:00 1970 + +++ b/fooThu Jan 01 00:00:00 1970 + @@ -1,1 +1,1 @@ diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -512,6 +512,7 @@ HG: dels= HG: files=changed HG: + HG: diff -r d2313f97106f changed HG: --- a/changedThu Jan 01 00:00:00 1970 + HG: +++ b/changedThu Jan 01 00:00:00 1970 + HG: @@ -1,1 +1,2 @@ @@ -573,6 +574,7 @@ HG: dels=removed HG: files=added removed HG: + HG: diff -r d2313f97106f added HG: --- /dev/nullThu Jan 01 00:00:00 1970 + HG: +++ b/added Thu Jan 01 00:00:00 1970 + HG: @@ -0,0 +1,1 @@ @@ -583,6 +585,7 @@ HG: dels=removed HG: files=added removed HG: + HG: diff -r d2313f97106f removed HG: --- a/removedThu Jan 01 00:00:00 1970 + HG: +++ /dev/nullThu Jan 01 00:00:00 1970 + HG: @@ -1,1 +0,0 @@ diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2682,7 +2682,7 @@ header.append('similarity index %d%%' % sim) header.append('%s from %s' % (copyop, path1)) header.append('%s to %s' % (copyop, path2)) -elif revs and not repo.ui.quiet: +elif revs: header.append(diffline(path1, revs)) # fctx.is | diffopts| what to | is fctx.data() To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6006: tests: add test to demonstrate issue4037
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY `hg diff --stat -q --config diff.git=0` does not output anything whereas it should print the stat. This is a quiet old bug dating to 2013 and looking at code I think it exists it since 2005 or when --stat was introduced. The next patch will fix the bug. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6006 AFFECTED FILES tests/test-diffstat.t CHANGE DETAILS diff --git a/tests/test-diffstat.t b/tests/test-diffstat.t --- a/tests/test-diffstat.t +++ b/tests/test-diffstat.t @@ -282,3 +282,10 @@ $ hg diff --stat --git c => new c | 0 1 files changed, 0 insertions(+), 0 deletions(-) + +Make sure `diff --stat -q --config diff.git-0` shows stat (issue4037) + + $ hg status + A new c + R c + $ hg diff --stat -q To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6005: uncommit: added interactive mode and modified fixdirstate(issue6062)
taapas1128 marked 4 inline comments as done. taapas1128 added a comment. @martinvonz I made the changes you asked . However I am not sure why `test-unamend.t` is changing because when `interactive` is false so it should behave exactly like the previous `_fixdirstate()` functioned . Can you provide some help with this ? I will work further based on your review. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6005 To: taapas1128, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6005: uncommit: added interactive mode and modified fixdirstate(issue6062)
taapas1128 updated this revision to Diff 14193. taapas1128 retitled this revision from "uncommit: added interactive mode and removed _fixdirstate(issue6062)" to "uncommit: added interactive mode and modified fixdirstate(issue6062)". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6005?vs=14192=14193 REVISION DETAIL https://phab.mercurial-scm.org/D6005 AFFECTED FILES hgext/uncommit.py tests/test-unamend.t tests/test-uncommit-interactive.t tests/test-uncommit.t CHANGE DETAILS diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -34,6 +34,7 @@ options ([+] can be repeated): + -i --interactive interactive mode to uncommit --keepallow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns diff --git a/tests/test-uncommit-interactive.t b/tests/test-uncommit-interactive.t new file mode 100644 --- /dev/null +++ b/tests/test-uncommit-interactive.t @@ -0,0 +1,969 @@ + +|| The test for `hg uncommit --interactive` || + + +Repo Setup + + + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [experimental] + > evolution.createmarkers=True + > evolution.allowunstable=True + > uncommitondirtywdir = true + > [extensions] + > uncommit = + > amend = + > drawdag=$TESTDIR/drawdag.py + > EOF + $ glog() { + > hg log -G --template '{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' "$@" + > } + + $ hg init repo + $ cd repo + + $ touch a + $ cat >> a << EOF + > 1 + > 2 + > 3 + > 4 + > 5 + > EOF + + $ hg add a + $ hg ci -m "The base commit" + +Make sure aborting the interactive selection does no magic +-- + + $ hg status + $ hg uncommit -i< q + > EOF + diff --git a/a b/a + new file mode 100644 + examine changes to 'a'? [Ynesfdaq?] q + + abort: user quit + [255] + $ hg status + +Make a commit with multiple hunks +- + + $ cat > a << EOF + > -2 + > -1 + > 0 + > 1 + > 2 + > 3 + > foo + > bar + > 4 + > 5 + > babar + > EOF + + $ hg diff + diff -r 7733902a8d94 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,5 +1,11 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +foo + +bar + 4 + 5 + +babar + + $ hg ci -m "another one" + +Not selecting anything to uncommit +== + + $ hg uncommit -i< y + > n + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] n + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + abort: nothing selected to uncommit + [255] + $ hg status + +Uncommit a chunk + + + $ hg uncommit -i< y + > y + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] y + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + + $ hg log -G --hidden + @ changeset: 3:678a59e5ff90 + | tag: tip + | parent: 0:7733902a8d94 + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: another one + | + | x changeset: 2:e9635f4beaf1 + |/ parent: 0:7733902a8d94 + |user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:pruned using uncommit + |summary: temporary commit for uncommiting f70fb463d5bf + | + | x changeset: 1:f70fb463d5bf + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using uncommit as 3:678a59e5ff90 + |summary: another one + | + o changeset: 0:7733902a8d94 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: The base commit + +The unselected part should be in the diff +- + + $ hg diff + diff -r 678a59e5ff90 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +The commit should contain the rest of part +-- + + $ hg exp + # HG changeset
D6005: uncommit: added interactive mode and removed _fixdirstate(issue6062)
taapas1128 updated this revision to Diff 14192. taapas1128 retitled this revision from "uncommit: added interactive mode and removed _fixdirstate()(issue6062)" to "uncommit: added interactive mode and removed _fixdirstate(issue6062)". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6005?vs=14191=14192 REVISION DETAIL https://phab.mercurial-scm.org/D6005 AFFECTED FILES hgext/uncommit.py tests/test-unamend.t tests/test-uncommit-interactive.t tests/test-uncommit.t CHANGE DETAILS diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -34,6 +34,7 @@ options ([+] can be repeated): + -i --interactive interactive mode to uncommit --keepallow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns diff --git a/tests/test-uncommit-interactive.t b/tests/test-uncommit-interactive.t new file mode 100644 --- /dev/null +++ b/tests/test-uncommit-interactive.t @@ -0,0 +1,969 @@ + +|| The test for `hg uncommit --interactive` || + + +Repo Setup + + + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [experimental] + > evolution.createmarkers=True + > evolution.allowunstable=True + > uncommitondirtywdir = true + > [extensions] + > uncommit = + > amend = + > drawdag=$TESTDIR/drawdag.py + > EOF + $ glog() { + > hg log -G --template '{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' "$@" + > } + + $ hg init repo + $ cd repo + + $ touch a + $ cat >> a << EOF + > 1 + > 2 + > 3 + > 4 + > 5 + > EOF + + $ hg add a + $ hg ci -m "The base commit" + +Make sure aborting the interactive selection does no magic +-- + + $ hg status + $ hg uncommit -i< q + > EOF + diff --git a/a b/a + new file mode 100644 + examine changes to 'a'? [Ynesfdaq?] q + + abort: user quit + [255] + $ hg status + +Make a commit with multiple hunks +- + + $ cat > a << EOF + > -2 + > -1 + > 0 + > 1 + > 2 + > 3 + > foo + > bar + > 4 + > 5 + > babar + > EOF + + $ hg diff + diff -r 7733902a8d94 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,5 +1,11 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +foo + +bar + 4 + 5 + +babar + + $ hg ci -m "another one" + +Not selecting anything to uncommit +== + + $ hg uncommit -i< y + > n + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] n + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + abort: nothing selected to uncommit + [255] + $ hg status + +Uncommit a chunk + + + $ hg uncommit -i< y + > y + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] y + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + + $ hg log -G --hidden + @ changeset: 3:678a59e5ff90 + | tag: tip + | parent: 0:7733902a8d94 + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: another one + | + | x changeset: 2:e9635f4beaf1 + |/ parent: 0:7733902a8d94 + |user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:pruned using uncommit + |summary: temporary commit for uncommiting f70fb463d5bf + | + | x changeset: 1:f70fb463d5bf + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using uncommit as 3:678a59e5ff90 + |summary: another one + | + o changeset: 0:7733902a8d94 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: The base commit + +The unselected part should be in the diff +- + + $ hg diff + diff -r 678a59e5ff90 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +The commit should contain the rest of part +-- + + $ hg exp + # HG
D6005: uncommit: added interactive mode and removed _fixdirstate()(issue6062)
martinvonz added a comment. I haven't reviewed much of it, but here are some initial comments INLINE COMMENTS > uncommit.py:101 > > -def _fixdirstate(repo, oldctx, newctx, match=None): > -""" fix the dirstate after switching the working directory from oldctx to > -newctx which can be result of either unamend or uncommit. > +def _uncommitdirstate(repo, oldctx, newctx, match, interactive): > +"""Fix the dirstate after switching the working directory from I don't think we need to rename it from `_fixdirstate()`, especially since it's used for both uncommit and unamend. (Fix commit message too, of course, if you switch back to the old name.) > uncommit.py:114 > +# us in defining the exact behavior > +m, a, r = repo.status(oldctx, ctx, match=match)[:3] > +for f in m: I've been trying to avoid accessing status fields by index because it's not very readable. Can you use the same pattern as below instead (i.e. `s.modifed` etc)? > uncommit.py:399 > +match=None > +interactive=0 > +_uncommitdirstate(repo, curctx, newpredctx, match, interactive) Instead of defining a value here, specify the argument by name when you call the function: `_uncommitdirstate(..., interactive=False)`. But it's probably better to just make `interactive` default to `False` and not pass it here. > uncommit.py:400 > +interactive=0 > +_uncommitdirstate(repo, curctx, newpredctx, match, interactive) > Keep the match optional instead? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6005 To: taapas1128, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6005: uncommit: added interactive mode and removed _fixdirstate()(issue6062)
taapas1128 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6005 AFFECTED FILES hgext/uncommit.py tests/test-unamend.t tests/test-uncommit-interactive.t tests/test-uncommit.t CHANGE DETAILS diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -34,6 +34,7 @@ options ([+] can be repeated): + -i --interactive interactive mode to uncommit --keepallow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns diff --git a/tests/test-uncommit-interactive.t b/tests/test-uncommit-interactive.t new file mode 100644 --- /dev/null +++ b/tests/test-uncommit-interactive.t @@ -0,0 +1,969 @@ + +|| The test for `hg uncommit --interactive` || + + +Repo Setup + + + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [experimental] + > evolution.createmarkers=True + > evolution.allowunstable=True + > uncommitondirtywdir = true + > [extensions] + > uncommit = + > amend = + > drawdag=$TESTDIR/drawdag.py + > EOF + $ glog() { + > hg log -G --template '{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' "$@" + > } + + $ hg init repo + $ cd repo + + $ touch a + $ cat >> a << EOF + > 1 + > 2 + > 3 + > 4 + > 5 + > EOF + + $ hg add a + $ hg ci -m "The base commit" + +Make sure aborting the interactive selection does no magic +-- + + $ hg status + $ hg uncommit -i< q + > EOF + diff --git a/a b/a + new file mode 100644 + examine changes to 'a'? [Ynesfdaq?] q + + abort: user quit + [255] + $ hg status + +Make a commit with multiple hunks +- + + $ cat > a << EOF + > -2 + > -1 + > 0 + > 1 + > 2 + > 3 + > foo + > bar + > 4 + > 5 + > babar + > EOF + + $ hg diff + diff -r 7733902a8d94 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,5 +1,11 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +foo + +bar + 4 + 5 + +babar + + $ hg ci -m "another one" + +Not selecting anything to uncommit +== + + $ hg uncommit -i< y + > n + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] n + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + abort: nothing selected to uncommit + [255] + $ hg status + +Uncommit a chunk + + + $ hg uncommit -i< y + > y + > n + > n + > EOF + diff --git a/a b/a + 3 hunks, 6 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + discard change 1/3 to 'a'? [Ynesfdaq?] y + + @@ -1,5 +4,7 @@ + 1 + 2 + 3 + +foo + +bar + 4 + 5 + discard change 2/3 to 'a'? [Ynesfdaq?] n + + @@ -4,2 +9,3 @@ + 4 + 5 + +babar + discard change 3/3 to 'a'? [Ynesfdaq?] n + + + $ hg log -G --hidden + @ changeset: 3:678a59e5ff90 + | tag: tip + | parent: 0:7733902a8d94 + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: another one + | + | x changeset: 2:e9635f4beaf1 + |/ parent: 0:7733902a8d94 + |user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:pruned using uncommit + |summary: temporary commit for uncommiting f70fb463d5bf + | + | x changeset: 1:f70fb463d5bf + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using uncommit as 3:678a59e5ff90 + |summary: another one + | + o changeset: 0:7733902a8d94 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: The base commit + +The unselected part should be in the diff +- + + $ hg diff + diff -r 678a59e5ff90 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,3 +1,6 @@ + +-2 + +-1 + +0 + 1 + 2 + 3 + +The commit should contain the rest of part +-- + + $ hg exp + # HG changeset patch + # User test + # Date 0 0 + # Thu Jan 01 00:00:00 1970 + + # Node ID 678a59e5ff90754d5e94719bd82ad169be773c21 + # Parent 7733902a8d94c789ca81d866bea1893d79442db6 + another one
D5299: phabricator: fallback reading arcanist config files
mharbison72 added inline comments. INLINE COMMENTS > phabricator.py:187 > +paths = [ > +vfsmod.vfs(encoding.encoding['ProgramData']).join( > + 'Phabricator', 'Arcanist', 'config'), s/.encoding/.environ/ ? > phabricator.py:200 > +if vfsmod.vfs(path).exists(): > +with open(path, 'rb') as f: > +config.update(json.load(f)) Should this be using vfs to open, instead of raw open? Using the vfs layer allows the class that provides posix-like functionality on Windows to be used. > phabricator.py:290 > +if not callsign: > +return callsign > query = callconduit(repo, b'diffusion.repository.search', It might be clearer to return None, since the function is to fetch the repoid. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5299 To: philpep, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6004: changegroup: move non-pruning of non-ellipsis manifests to _prunemanifests()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1c1c4ef8b72e: changegroup: move non-pruning of non-ellipsis manifests to _prunemanifests() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6004?vs=14187=14190 REVISION DETAIL https://phab.mercurial-scm.org/D6004 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -1073,11 +1073,6 @@ # because of narrow clones). Do this even for the root # directory (tree=='') prunednodes = [] -elif not self._ellipses: -# In non-ellipses case and large repositories, it is better to -# prevent calling of store.rev and store.linkrev on a lot of -# nodes as compared to sending some extra data -prunednodes = nodes.copy() else: # Avoid sending any manifest nodes we can prove the # client already has by checking linkrevs. See the @@ -1110,6 +1105,11 @@ yield tree, [] def _prunemanifests(self, store, nodes, commonrevs): +if not self._ellipses: +# In non-ellipses case and large repositories, it is better to +# prevent calling of store.rev and store.linkrev on a lot of +# nodes as compared to sending some extra data +return nodes.copy() # This is split out as a separate method to allow filtering # commonrevs in extension code. # To: martinvonz, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel