Patchwork D1869: update: display the obsfate of hidden revision we update to

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 1:42 p.m.
Message ID <f6737789838cdfff599aeaade2ea1941@localhost.localdomain>
Download mbox | patch
Permalink /patch/26898/
State Not Applicable
Headers show

Comments

phabricator - Jan. 18, 2018, 1:42 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG35a0f6f31eef: update: display the obsfate of hidden revision we update to (authored by lothiraldan, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1869?vs=4847&id=4900#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1869?vs=4847&id=4900

REVISION DETAIL
  https://phab.mercurial-scm.org/D1869

AFFECTED FILES
  mercurial/commands.py
  tests/test-directaccess.t
  tests/test-log.t
  tests/test-obshistory.t
  tests/test-obsmarker-template.t
  tests/test-obsolete.t
  tests/test-rebase-obsolete.t
  tests/test-update-branches.t

CHANGE DETAILS




To: lothiraldan, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -521,6 +521,7 @@ 
   $ hg up --quiet 0          # we should be able to update to 3 directly
   $ hg up --quiet --hidden 3 # but not implemented yet.
   updating to a hidden changeset 6efa171f091b
+  (hidden revision '6efa171f091b' was rewritten as: d047485b3896)
   $ hg book -f bm
   $ hg up
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -532,6 +533,7 @@ 
   $ hg up --quiet 0          # we should be able to update to 3 directly
   $ hg up --quiet --hidden 3 # but not implemented yet.
   updating to a hidden changeset 6efa171f091b
+  (hidden revision '6efa171f091b' was rewritten as: d047485b3896)
   $ hg up 5
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -282,6 +282,7 @@ 
 
   $ hg --hidden up -qr 'first(hidden())'
   updating to a hidden changeset 42ccdea3bb16
+  (hidden revision '42ccdea3bb16' is pruned)
   $ hg rebase --rev 13 --dest 15
   rebasing 13:98f6af4ee953 "C"
   $ hg log -G
@@ -615,6 +616,7 @@ 
 
   $ hg up --hidden 9
   updating to a hidden changeset 4bde274eefcf
+  (hidden revision '4bde274eefcf' was rewritten as: acd174b7ab39)
   3 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo J > J
   $ hg add J
@@ -736,6 +738,7 @@ 
   $ hg commit --amend -m B2
   $ hg up --hidden 'desc(B0)'
   updating to a hidden changeset a8b11f55fb19
+  (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo C > C
   $ hg add C
@@ -761,6 +764,7 @@ 
 
   $ hg up --hidden 'desc(B0)'
   updating to a hidden changeset a8b11f55fb19
+  (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo D > D
   $ hg add D
@@ -878,6 +882,7 @@ 
   $ hg commit --amend -m "10'"
   $ hg up 10 --hidden
   updating to a hidden changeset 121d9e3bc4c6
+  (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo "bar" > foo
   $ hg add foo
@@ -1633,6 +1638,7 @@ 
 
   $ hg update -q $C --hidden
   updating to a hidden changeset 7829726be4dc
+  (hidden revision '7829726be4dc' is pruned)
   $ hg rebase -s $B -d $D
   rebasing 1:2ec65233581b "B"
   merging D
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -63,6 +63,7 @@ 
   -1:000000000000 (public) [tip ] 
   $ hg up --hidden tip --quiet
   updating to a hidden changeset 97b7c2d76b18
+  (hidden revision '97b7c2d76b18' is pruned)
 
 Killing a single changeset with itself should fail
 (simple local safeguard)
diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -76,6 +76,7 @@ 
 ---------------
   $ hg up 'desc(A0)' --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: d004c8f274b9)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -148,6 +149,7 @@ 
   
   $ hg up 'desc(A1)' --hidden
   updating to a hidden changeset a468dc9b3633
+  (hidden revision 'a468dc9b3633' was rewritten as: d004c8f274b9)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -416,6 +418,7 @@ 
 
   $ hg up 'obsolete()' --hidden
   updating to a hidden changeset 471597cad322
+  (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -625,6 +628,7 @@ 
 
   $ hg up 'desc(A0)' --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -650,6 +654,7 @@ 
   
   $ hg up 'desc(B0)' --hidden
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show both predecessors as they should be both
@@ -816,6 +821,7 @@ 
   
   $ hg update --hidden 'desc(A0)'
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg commit --amend -m "A2"
   2 new content-divergent changesets
@@ -889,6 +895,7 @@ 
 
   $ hg up 'desc(A0)' --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' has diverged)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -1155,6 +1162,7 @@ 
 
   $ hg up 'desc(A0)' --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
@@ -1180,6 +1188,7 @@ 
   
   $ hg up 'desc(B0)' --hidden
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should both predecessors as they are visible
@@ -1211,6 +1220,7 @@ 
   
   $ hg up 'desc(B1)' --hidden
   updating to a hidden changeset b7ea6d14e664
+  (hidden revision 'b7ea6d14e664' was rewritten as: eb5a0daa2192)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should both predecessors as they are visible
@@ -1614,6 +1624,7 @@ 
 
   $ hg up -r "desc(B0)" --hidden
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' is pruned)
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg tlog
   o  f897c6137566
@@ -2077,6 +2088,7 @@ 
   
   $ hg up --hidden 4
   updating to a hidden changeset 9bd10a0775e4
+  (hidden revision '9bd10a0775e4' has diverged)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg rebase -r 7 -d 8 --config extensions.rebase=
   rebasing 7:ba2ed02b0c9a "Add A,B,C"
@@ -2322,6 +2334,7 @@ 
 
   $ hg up -r "desc(A0)" --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' is pruned)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg commit --amend -m "A2"
   $ hg debugobsolete --record-parent `getid "."`
@@ -2332,6 +2345,7 @@ 
 
   $ hg up "desc(A0)" --hidden
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' is pruned)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tlog
   @  471f378eab4c
@@ -2486,6 +2500,7 @@ 
 
   $ hg up 'desc("A0")' --hidden
   updating to a hidden changeset 471597cad322
+  (hidden revision '471597cad322' is pruned)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 # todo: the obsfate output is not ideal
@@ -2498,6 +2513,7 @@ 
   
   $ hg up -r 'desc("A2")' --hidden
   updating to a hidden changeset 0d0ef4bdf70e
+  (hidden revision '0d0ef4bdf70e' is pruned)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ hg fatelog --hidden
diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t
--- a/tests/test-obshistory.t
+++ b/tests/test-obshistory.t
@@ -56,6 +56,7 @@ 
   [255]
   $ hg update --hidden "desc(A0)"
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with pruned commit
@@ -118,6 +119,7 @@ 
   [255]
   $ hg up --hidden -r 'desc(B0)'
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' is pruned)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with splitted commit
@@ -194,6 +196,7 @@ 
   [255]
   $ hg update --hidden 'min(desc(A0))'
   updating to a hidden changeset 471597cad322
+  (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with lots of splitted commit
@@ -292,6 +295,7 @@ 
   [255]
   $ hg update --hidden 'min(desc(A0))'
   updating to a hidden changeset de7290d8b885
+  (hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with folded commit
@@ -370,13 +374,15 @@ 
   [255]
   $ hg update --hidden 'desc(A0)'
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg update 0dec01379d3b
   abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192!
   (use --hidden to access hidden revisions)
   [255]
   $ hg update --hidden 'desc(B0)'
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with divergence
@@ -411,6 +417,7 @@ 
   
   $ hg update --hidden 'desc(A0)'
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg commit --amend -m "A2"
   2 new content-divergent changesets
@@ -450,6 +457,7 @@ 
   [255]
   $ hg update --hidden 'desc(A0)'
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' has diverged)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test output with amended + folded commit
@@ -544,9 +552,11 @@ 
   [255]
   $ hg update --hidden 'desc(A0)'
   updating to a hidden changeset 471f378eab4c
+  (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg update --hidden 0dec01379d3b
   updating to a hidden changeset 0dec01379d3b
+  (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg update 0dec01379d3b
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1941,6 +1941,7 @@ 
 
   $ hg up 1 -q --hidden
   updating to a hidden changeset a765632148dc
+  (hidden revision 'a765632148dc' is pruned)
   $ hg log --template='{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t
--- a/tests/test-directaccess.t
+++ b/tests/test-directaccess.t
@@ -157,6 +157,7 @@ 
 
   $ hg up 28ad74
   updating to a hidden changeset 28ad74487de9
+  (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ hg up 3
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -43,6 +43,7 @@ 
     lock as lockmod,
     merge as mergemod,
     obsolete,
+    obsutil,
     patch,
     phases,
     pycompat,
@@ -5538,7 +5539,12 @@ 
         ctx = scmutil.revsingle(repo, rev, rev)
         rev = ctx.rev()
         if ctx.hidden():
-            ui.warn(_("updating to a hidden changeset %s\n") % ctx.hex()[:12])
+            ctxstr = ctx.hex()[:12]
+            ui.warn(_("updating to a hidden changeset %s\n") % ctxstr)
+
+            if ctx.obsolete():
+                obsfatemsg = obsutil._getfilteredreason(repo, ctxstr, ctx)
+                ui.warn("(%s)\n" % obsfatemsg)
 
         repo.ui.setconfig('ui', 'forcemerge', tool, 'update')