comparison mercurial/commands.py @ 19333:0cfb62e043e8

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.
author Durham Goode <durham@fb.com>
date Tue, 18 Jun 2013 13:05:16 -0700
parents 59cdd3a7e281
children 83d0df2ddf3f
comparison
equal deleted inserted replaced
19329:84dc9669bd71 19333:0cfb62e043e8
4354 filenodes.append(cp.filenode(file_)) 4354 filenodes.append(cp.filenode(file_))
4355 except error.LookupError: 4355 except error.LookupError:
4356 pass 4356 pass
4357 if not filenodes: 4357 if not filenodes:
4358 raise util.Abort(_("'%s' not found in manifest!") % file_) 4358 raise util.Abort(_("'%s' not found in manifest!") % file_)
4359 fl = repo.file(file_) 4359 p = []
4360 p = [repo.lookup(fl.linkrev(fl.rev(fn))) for fn in filenodes] 4360 for fn in filenodes:
4361 fctx = repo.filectx(file_, fileid=fn)
4362 p.append(fctx.node())
4361 else: 4363 else:
4362 p = [cp.node() for cp in ctx.parents()] 4364 p = [cp.node() for cp in ctx.parents()]
4363 4365
4364 displayer = cmdutil.show_changeset(ui, repo, opts) 4366 displayer = cmdutil.show_changeset(ui, repo, opts)
4365 for n in p: 4367 for n in p: