comparison mercurial/cmdutil.py @ 4478:b2b55acbacdd

Add support for url#id syntax This allows you to do: hg clone http://server/repo#stable which is equivalent to: hg clone -r stable http://server/repo Future incoming, outgoing, and push commands will default to using this id because it's recorded in the default path. Other commands that accept URLs (push, pull, bundle, incoming, and outgoing) also accept this syntax.
author Matt Mackall <mpm@selenic.com>
date Fri, 01 Jun 2007 18:40:14 -0500
parents 736e49292809
children 591322269fed
comparison
equal deleted inserted replaced
4477:6cbfa740c129 4478:b2b55acbacdd
8 from node import * 8 from node import *
9 from i18n import _ 9 from i18n import _
10 import os, sys, mdiff, bdiff, util, templater, patch 10 import os, sys, mdiff, bdiff, util, templater, patch
11 11
12 revrangesep = ':' 12 revrangesep = ':'
13
14 def parseurl(url, revs):
15 '''parse url#branch, returning url, branch + revs'''
16
17 if '#' not in url:
18 return url, (revs or None)
19
20 url, rev = url.split('#', 1)
21 return url, revs + [rev]
13 22
14 def revpair(repo, revs): 23 def revpair(repo, revs):
15 '''return pair of nodes, given list of revisions. second item can 24 '''return pair of nodes, given list of revisions. second item can
16 be None, meaning use working dir.''' 25 be None, meaning use working dir.'''
17 26