debugmutation: don't use the unfiltered repo by default

Summary:
The `debugmutation` command uses the unfiltered repo to resolve the
user-provided revs.  It shouldn't do this unless the user passes `--hidden`.

Reviewed By: mitrandir77

Differential Revision: D17156722

fbshipit-source-id: 5ab7704acc598cf8b7c1640a3096ba0ce6ac73e9
This commit is contained in:
Mark Thomas 2019-09-06 00:40:29 -07:00 committed by Facebook Github Bot
parent 8dc0110c6d
commit 465e91bbe5
2 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ from .cmdtable import command
)
def debugmutation(ui, repo, *revs, **opts):
"""display the mutation history (or future) of a commit"""
repo = repo.unfiltered()
unfi = repo.unfiltered()
opts = pycompat.byteskwargs(opts)
def describe(entry, showsplit=False, showfoldwith=None):
@ -50,7 +50,7 @@ def debugmutation(ui, repo, *revs, **opts):
return ("%s by %s at %s%s%s") % (mutop, mutuser, mutdate, extra, origin)
def expandhistory(node):
entry = mutation.lookup(repo, node)
entry = mutation.lookup(unfi, node)
if entry is not None:
desc = describe(entry, showsplit=True) + " from:"
preds = util.removeduplicates(entry.preds())
@ -59,10 +59,10 @@ def debugmutation(ui, repo, *revs, **opts):
return []
def expandfuture(node):
succsets = mutation.lookupsuccessors(repo, node)
succsets = mutation.lookupsuccessors(unfi, node)
edges = []
for succset in succsets:
entry = mutation.lookupsplit(repo, succset[0])
entry = mutation.lookupsplit(unfi, succset[0])
desc = describe(entry, showfoldwith=node) + " into:"
edges.append((desc, succset))
return edges

View File

@ -337,7 +337,7 @@ Unhide some old commits and show their mutations in the log
o 0: d20a80d4def3 'base'
Debugmutatation looking forward
$ hg debugmutation -s c4484fcb5ac0f15058c6595a56d239d4ed707bee
$ hg debugmutation -s c4484fcb5ac0f15058c6595a56d239d4ed707bee --hidden
* c4484fcb5ac0f15058c6595a56d239d4ed707bee diverges
:= histedit by test at 1970-01-01T00:00:00 into:
: 961157b412e21813bbee86fd1704fb09bd25874b
@ -385,7 +385,7 @@ Histedit with exec that amends in between folds
| commit 4'
o 0: c2a29f8b7d7a 'commit 1'
$ hg debugmutation "all()"
$ hg debugmutation "all()" --hidden
* c2a29f8b7d7a23d58e698384280df426802a1465
* 08d8367dafb9bb90c58101707eca32b726ca635a
* 15a208dbcdc54b4f841ffecf9d13f98675933242
@ -438,7 +438,7 @@ Histedit with stop, extra commit, and fold
|
o 0: c2a29f8b7d7a 'commit 1'
$ hg debugmutation "all()"
$ hg debugmutation "all()" --hidden
* c2a29f8b7d7a23d58e698384280df426802a1465
* 08d8367dafb9bb90c58101707eca32b726ca635a
* 15a208dbcdc54b4f841ffecf9d13f98675933242
@ -512,7 +512,7 @@ Revsets obey visibility rules
> A # revive: C
> EOS
$ hg debugmutation "all()"
$ hg debugmutation "all()" --hidden
* 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
* 112478962961147124edd43549aedd1a335e44bf
* 2cb21a570bd242eb1225414c6634ed29cc9cfe93 amend by test at 1970-01-01T00:00:00 from: