mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
parents: change parents command to use filectx
Changes the parents command to use filectx to look up the change node instead of doing it manually. This allows extensions to modify the file-to-commit relationship behind the filectx api.
This commit is contained in:
parent
174b9c6416
commit
f9e0cf8458
@ -4356,8 +4356,10 @@ def parents(ui, repo, file_=None, **opts):
|
||||
pass
|
||||
if not filenodes:
|
||||
raise util.Abort(_("'%s' not found in manifest!") % file_)
|
||||
fl = repo.file(file_)
|
||||
p = [repo.lookup(fl.linkrev(fl.rev(fn))) for fn in filenodes]
|
||||
p = []
|
||||
for fn in filenodes:
|
||||
fctx = repo.filectx(file_, fileid=fn)
|
||||
p.append(fctx.node())
|
||||
else:
|
||||
p = [cp.node() for cp in ctx.parents()]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user