Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 7757:af6a63438a8a
identify: have consistent output for local repositories
Also, add some extensive testing for it (hardly any in the suite so far).
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 13 Feb 2009 11:32:33 +0100 |
parents | ec9b726a9428 |
children | fece056bf240 |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Feb 12 18:26:09 2009 +0100 +++ b/mercurial/commands.py Fri Feb 13 11:32:33 2009 +0100 @@ -1538,9 +1538,12 @@ default = not (num or id or branch or tags) output = [] + revs = [] if source: source, revs, checkout = hg.parseurl(ui.expandpath(source), []) - srepo = hg.repository(ui, source) + repo = hg.repository(ui, source) + + if not repo.local(): if not rev and revs: rev = revs[0] if not rev: @@ -1548,7 +1551,7 @@ if num or branch or tags: raise util.Abort( "can't query remote revision number, branch, or tags") - output = [hexfunc(srepo.lookup(rev))] + output = [hexfunc(repo.lookup(rev))] elif not rev: ctx = repo[None] parents = ctx.parents() @@ -1568,7 +1571,7 @@ if num: output.append(str(ctx.rev())) - if not source and default and not ui.quiet: + if repo.local() and default and not ui.quiet: b = util.tolocal(ctx.branch()) if b != 'default': output.append("(%s)" % b)