Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 4894:be5dc5e3ab2d
hg parents: don't pass an OS-specific path to repo.filectx
The only reason to use the matcher code instead of calling util.canonpath
directly is to be able to use "path:canonical/path/to/file" patterns.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 17 Jul 2007 09:08:29 -0300 |
parents | 242026115e6a |
children | ee04732fe61d c4dd58af0fc8 |
comparison
equal
deleted
inserted
replaced
4884:931f901ab811 | 4894:be5dc5e3ab2d |
---|---|
1976 which the file was last changed (before the working directory | 1976 which the file was last changed (before the working directory |
1977 revision or the argument to --rev if given) is printed. | 1977 revision or the argument to --rev if given) is printed. |
1978 """ | 1978 """ |
1979 rev = opts.get('rev') | 1979 rev = opts.get('rev') |
1980 if file_: | 1980 if file_: |
1981 ctx = repo.filectx(file_, changeid=rev) | 1981 files, match, anypats = cmdutil.matchpats(repo, (file_,), opts) |
1982 if anypats or len(files) != 1: | |
1983 raise util.Abort(_('can only specify an explicit file name')) | |
1984 ctx = repo.filectx(files[0], changeid=rev) | |
1982 elif rev: | 1985 elif rev: |
1983 ctx = repo.changectx(rev) | 1986 ctx = repo.changectx(rev) |
1984 else: | 1987 else: |
1985 ctx = repo.workingctx() | 1988 ctx = repo.workingctx() |
1986 p = [cp.node() for cp in ctx.parents()] | 1989 p = [cp.node() for cp in ctx.parents()] |