Mercurial > hg-stable
changeset 4667:c7a81e3ae80f
identify: work with remote repos
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 21 Jun 2007 11:54:16 -0500 |
parents | 48c94bffdb28 |
children | e241598e956f 6858a7477a5e |
files | mercurial/cmdutil.py mercurial/commands.py |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Jun 21 11:54:13 2007 -0500 +++ b/mercurial/cmdutil.py Thu Jun 21 11:54:16 2007 -0500 @@ -316,7 +316,7 @@ try: repo = hg.repository(ui, path=path) ui = repo.ui - if not repo.local(): + if not repo.local() and cmd not in commands.remoterepo.split(): raise util.Abort(_("repository '%s' is not local") % path) except hg.RepoError: if cmd not in commands.optionalrepo.split():
--- a/mercurial/commands.py Thu Jun 21 11:54:13 2007 -0500 +++ b/mercurial/commands.py Thu Jun 21 11:54:16 2007 -0500 @@ -1447,7 +1447,14 @@ default = not (num or id or branch or tags) output = [] - if not rev: + if not repo.local(): + if not rev: + rev = "tip" + if num or branch or tags: + raise util.Abort( + "can't query remote revision number, branch, or tags") + output = [hexfunc(repo.lookup(rev))] + elif not rev: ctx = repo.workingctx() parents = ctx.parents() changed = False @@ -1466,7 +1473,7 @@ if num: output.append(str(ctx.rev())) - if 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) @@ -3056,6 +3063,7 @@ norepo = ("clone init version help debugancestor debugcomplete debugdata" " debugindex debugindexdot debugdate debuginstall") optionalrepo = ("paths serve showconfig") +remoterepo = ("identify") def dispatch(args): try: