D1591: visibility: improve the message when accessing filtered obsolete rev
yuja added inline comments. INLINE COMMENTS > obsutil.py:871 > +""" > +successors = successorssets(unfilteredrepo, ctx.node()) > +fate = _getobsfate(successors) Maybe it's okay to pass a "filtered" repo to this function as `templatekw.showsuccessorssets()` does. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: yuja, krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
yuja added inline comments. INLINE COMMENTS > context.py:446 > +reason = obsutil._getfilteredreason(unfilteredrepo, ctx) > +msg = _("hidden revision '%s' %s") % (changeid, reason) > +else: Not translatable. Needs a table of {'pruned': _("hidden revision '%s' is pruned"), ..., } Can you send a followup? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: yuja, krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
This revision was automatically updated to reflect the committed changes. Closed by commit rHG265cd9e19d26: visibility: improve the message when accessing filtered obsolete rev (authored by lothiraldan, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4746=4764 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-directaccess.t tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -197,7 +197,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1337,7 +1337,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,551 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + updating to a hidden changeset 471f378eab4c + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + updating to a hidden changeset 0dec01379d3b + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | +
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4746. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4703=4746 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-directaccess.t tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -197,7 +197,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1337,7 +1337,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,551 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + updating to a hidden changeset 471f378eab4c + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + updating to a hidden changeset 0dec01379d3b + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan added a comment. @krbullock Done I pulled from somewhere (likely hg-commited) and get an obs-marker authored by you: x 72ca90721675 (40698) visibility: improve the message when accessing filtered obsolete rev | rewritten(meta, date) as 65044dd2280c by Boris Feld(Fri Jan 05 09:12:08 2018 +0100) | | rewritten as f34ff7e24012 by Kevin Bullock (Thu Jan 04 21:01:44 2018 -0600) | | But I didn't receive f34ff7e24012, do you know what happened? I'm trying to check if there is a bug involved somewhere. Maybe you stripped f34ff7e24012 with a version of Mercurial that doesn't strip related markers? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4703. lothiraldan marked an inline comment as done. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4679=4703 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-directaccess.t tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -197,7 +197,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1337,7 +1337,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,551 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + updating to a hidden changeset 471f378eab4c + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + updating to a hidden changeset 0dec01379d3b + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary:
D1591: visibility: improve the message when accessing filtered obsolete rev
krbullock requested changes to this revision. krbullock added a comment. This revision now requires changes to proceed. This has new failures in test-obshistory.t and test-directaccess.t, can you rebase? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
krbullock accepted this revision. krbullock added a comment. Queued, thanks REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan marked an inline comment as done. lothiraldan added inline comments. INLINE COMMENTS > krbullock wrote in obsutil.py:780 > These should be 'superseded' and 'superseded_split' (in the docstring above > as well as here) Thank you, it's fixed now. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4679. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4527=4679 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -196,7 +196,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1324,7 +1324,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + + $ echo 42 >> a + $ hg commit -A -m "A0" + adding
D1591: visibility: improve the message when accessing filtered obsolete rev
krbullock requested changes to this revision. krbullock added a comment. This revision now requires changes to proceed. One nit, otherwise looks nice! INLINE COMMENTS > obsutil.py:780 > +else: > +return 'superseed_split' > + These should be 'superseded' and 'superseded_split' (in the docstring above as well as here) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit, krbullock Cc: krbullock, pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
pulkit added a comment. Looks good to me but you forgot to update the commit message. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan marked an inline comment as done. lothiraldan added inline comments. INLINE COMMENTS > pulkit wrote in test-obshistory.t:190 > This one looks odd. Please make this one similar to other split message. Fixed, thank you for the catch! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4527. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4250=4527 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -196,7 +196,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1324,7 +1324,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + + $ echo 42 >> a + $ hg commit -A -m "A0" + adding
D1591: visibility: improve the message when accessing filtered obsolete rev
pulkit requested changes to this revision. pulkit added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > test-obshistory.t:190 > + $ hg update 471597cad322 > + abort: hidden revision '471597cad322' successors: 337fec4d2edc, > f257fde29c7a! > + (use --hidden to access hidden revisions) This one looks odd. Please make this one similar to other split message. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4250. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4156=4250 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -196,7 +196,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1324,7 +1324,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + + $ echo 42 >> a + $ hg commit -A -m "A0" + adding
D1591: visibility: improve the message when accessing filtered obsolete rev
pulkit requested changes to this revision. pulkit added a comment. This revision now requires changes to proceed. Apart from the comments, this patch looks good to me. INLINE COMMENTS > context.py:458 > > +def _getobsoletereason(ctx, unfilteredrepo): > +successors = obsutil.successorssets(unfilteredrepo, ctx.node()) nit: I think in such cases we pass repo as first argument. Also, I don't think this is a good place for this function, maybe move this to `obsutil.py` too. > obsutil.py:755 > +def _getobsfate(successorssets): > +""" Compute a changeset obsolescence fate based on his successorssets. > +Successors can be the tipmost ones or the immediate ones. This function s/his/it's > obsutil.py:759 > +be used by internal functions only. > +Returns one fate in the following list: > +- pruned s/in the following list/ from the following values > test-obshistory.t:287 > + $ hg update de7290d8b885 > + abort: hidden revision 'de7290d8b885' was rewritten as: 337fec4d2edc, > f257fde29c7a and 2 more! > + (use --hidden to access hidden revisions) We should follow the graph description here too i.e. saying `split as x,y,z`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4156. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4116=4156 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -196,7 +196,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1324,7 +1324,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + + $ echo 42 >> a + $ hg commit -A -m "A0" + adding
D1591: visibility: improve the message when accessing filtered obsolete rev
pulkit added a comment. In https://phab.mercurial-scm.org/D1591#27317, @lothiraldan wrote: > After thinking more about your proposition, I also think that would be a nice improvement. This way we won't pollute the line helping people to access it anyway. > > What I'm proposing: > > abort: hidden revision '13bedc178fce' is pruned! > abort: hidden revision '13bedc178fce' has diverged! > abort: hidden revision '13bedc178fce' was rewritten as X, Y and 2 more! > > > The proposed phrase without divergence is closer to obsfate this way. +1. I also like this way. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42 Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
durin42 added a comment. In https://phab.mercurial-scm.org/D1591#27317, @lothiraldan wrote: > After thinking more about your proposition, I also think that would be a nice improvement. This way we won't pollute the line helping people to access it anyway. > > What I'm proposing: > > abort: hidden revision '13bedc178fce' is pruned! > abort: hidden revision '13bedc178fce' has diverged! > abort: hidden revision '13bedc178fce' was rewritten as X, Y and 2 more! > > > The proposed phrase without divergence is closer to obsfate this way. > > @durin42 what do you think? Works for me, make it so. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan added a comment. After thinking more about your proposition, I also think that would be a nice improvement. This way we won't pollute the line helping people to access it anyway. What I'm proposing: abort: hidden revision '13bedc178fce' is pruned! abort: hidden revision '13bedc178fce' has diverged! abort: hidden revision '13bedc178fce' was rewritten as X, Y and 2 more! The proposed phrase without divergence is closer to obsfate this way. @durin42 what do you think? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan added inline comments. INLINE COMMENTS > durin42 wrote in test-log.t:1720 > would it be better to put the verb in the abort top-line, isntead of the > hint? that is: > > abort: hidden revision 'a' is pruned! > (use --hidden to access hidden revisions) > > or > > abort: hidden revision 'a' is obsolete with successor: eb5a0daa2192 > (use --hidden to access hidden revisions) > > What do you think? It's an interesting proposition, I don't have a strong opinion. The current behavior is the same as Evolve so it may be better to keep the same, but again no strong opinion. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
durin42 added inline comments. INLINE COMMENTS > test-log.t:1720 >$ hg log -r a >abort: hidden revision 'a'! > + (use --hidden to access hidden revisions; pruned) would it be better to put the verb in the abort top-line, isntead of the hint? that is: abort: hidden revision 'a' is pruned! (use --hidden to access hidden revisions) or abort: hidden revision 'a' is obsolete with successor: eb5a0daa2192 (use --hidden to access hidden revisions) What do you think? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY When trying to access filtered revision, it is likely because they have been obsoleted by an obs-marker. The current message shows how to access the revision anyway: (use --hidden to access hidden revisions) But in the case of an obsoleted revision, the user is likely to want to update to or use the successor of the revision. We update the message to display more information about in these cases: (use --hidden to access hidden revisions; pruned) (use --hidden to access hidden revisions; successor: 4ae3a4151de9) (use --hidden to access hidden revisions; diverged) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -197,7 +197,7 @@ [255] $ hg log -r 4 abort: hidden revision '4'! - (use --hidden to access hidden revisions) + (use --hidden to access hidden revisions; successor: 5601fb93a350) [255] $ hg debugrevspec 'rev(6)' $ hg debugrevspec 'rev(4)' @@ -1325,7 +1325,7 @@ $ hg book -d bookb $ hg log -r 13bedc178fce abort: hidden revision '13bedc178fce'! - (use --hidden to access hidden revisions) + (use --hidden to access hidden revisions; successor: a9b1f8652753) [255] Empty out the test extension, as it isn't compatible with later parts diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c'! + (use --hidden to access hidden revisions; successor: 4ae3a4151de9) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b'! + (use --hidden to access hidden revisions; pruned) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd