##// END OF EJS Templates
identify: work with remote repos
Matt Mackall -
r4667:c7a81e3a default
parent child Browse files
Show More
@@ -316,7 +316,7 b' def dispatch(ui, args):'
316 try:
316 try:
317 repo = hg.repository(ui, path=path)
317 repo = hg.repository(ui, path=path)
318 ui = repo.ui
318 ui = repo.ui
319 if not repo.local():
319 if not repo.local() and cmd not in commands.remoterepo.split():
320 raise util.Abort(_("repository '%s' is not local") % path)
320 raise util.Abort(_("repository '%s' is not local") % path)
321 except hg.RepoError:
321 except hg.RepoError:
322 if cmd not in commands.optionalrepo.split():
322 if cmd not in commands.optionalrepo.split():
@@ -1447,7 +1447,14 b' def identify(ui, repo, rev=None, num=Non'
1447 default = not (num or id or branch or tags)
1447 default = not (num or id or branch or tags)
1448 output = []
1448 output = []
1449
1449
1450 if not rev:
1450 if not repo.local():
1451 if not rev:
1452 rev = "tip"
1453 if num or branch or tags:
1454 raise util.Abort(
1455 "can't query remote revision number, branch, or tags")
1456 output = [hexfunc(repo.lookup(rev))]
1457 elif not rev:
1451 ctx = repo.workingctx()
1458 ctx = repo.workingctx()
1452 parents = ctx.parents()
1459 parents = ctx.parents()
1453 changed = False
1460 changed = False
@@ -1466,7 +1473,7 b' def identify(ui, repo, rev=None, num=Non'
1466 if num:
1473 if num:
1467 output.append(str(ctx.rev()))
1474 output.append(str(ctx.rev()))
1468
1475
1469 if default and not ui.quiet:
1476 if repo.local() and default and not ui.quiet:
1470 b = util.tolocal(ctx.branch())
1477 b = util.tolocal(ctx.branch())
1471 if b != 'default':
1478 if b != 'default':
1472 output.append("(%s)" % b)
1479 output.append("(%s)" % b)
@@ -3056,6 +3063,7 b' table = {'
3056 norepo = ("clone init version help debugancestor debugcomplete debugdata"
3063 norepo = ("clone init version help debugancestor debugcomplete debugdata"
3057 " debugindex debugindexdot debugdate debuginstall")
3064 " debugindex debugindexdot debugdate debuginstall")
3058 optionalrepo = ("paths serve showconfig")
3065 optionalrepo = ("paths serve showconfig")
3066 remoterepo = ("identify")
3059
3067
3060 def dispatch(args):
3068 def dispatch(args):
3061 try:
3069 try:
General Comments 0
You need to be logged in to leave comments. Login now