mercurial/commands.py
changeset 4896 ee04732fe61d
parent 4888 2d545b98a7bc
parent 4894 be5dc5e3ab2d
child 4915 8535c1770dd3
child 4948 6fd953d5faea
equal deleted inserted replaced
4893:44b0031514c1 4896:ee04732fe61d
  1991     which the file was last changed (before the working directory
  1991     which the file was last changed (before the working directory
  1992     revision or the argument to --rev if given) is printed.
  1992     revision or the argument to --rev if given) is printed.
  1993     """
  1993     """
  1994     rev = opts.get('rev')
  1994     rev = opts.get('rev')
  1995     if file_:
  1995     if file_:
  1996         ctx = repo.filectx(file_, changeid=rev)
  1996         files, match, anypats = cmdutil.matchpats(repo, (file_,), opts)
       
  1997         if anypats or len(files) != 1:
       
  1998             raise util.Abort(_('can only specify an explicit file name'))
       
  1999         ctx = repo.filectx(files[0], changeid=rev)
  1997     elif rev:
  2000     elif rev:
  1998         ctx = repo.changectx(rev)
  2001         ctx = repo.changectx(rev)
  1999     else:
  2002     else:
  2000         ctx = repo.workingctx()
  2003         ctx = repo.workingctx()
  2001     p = [cp.node() for cp in ctx.parents()]
  2004     p = [cp.node() for cp in ctx.parents()]