Skip to content

Commit

Permalink
Allow to git cinnabar fetch with an url instead of a remote name
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jul 25, 2016
1 parent 8d62df3 commit eee6bc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-cinnabar
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ def do_rollback(ref):

def do_fetch(remote, rev):
if not re.match('[0-9a-f]{40}$', rev.lower()):
url = Git.config('remote.%s.url' % remote)
if remote.startswith('hg:'):
url = remote
else:
url = Git.config('remote.%s.url' % remote)
if not url:
print >>sys.stderr, "Unknown remote:", remote
return 1
Expand Down Expand Up @@ -463,7 +466,7 @@ def main(argv):

subparser = subparsers.add_parser(
'fetch', help='fetch a changeset from a mercurial remote')
subparser.add_argument('remote', help='mercurial remote')
subparser.add_argument('remote', help='mercurial remote name or url')
subparser.add_argument('rev', help='mercurial changeset to fetch')

subparser = subparsers.add_parser(
Expand Down

0 comments on commit eee6bc8

Please sign in to comment.