comparison mercurial/hg.py @ 10358:d42821cd5c96

pull: with -u and -r, update to the first revision given This makes pull consistent with clone. The actual change is in mercurial.hg.parseurl, changing its checkout result, which is only used for pull.
author Sune Foldager <cryo@cyanite.org>
date Sat, 06 Feb 2010 20:24:51 +0100
parents 08a0f04b56bd
children d757bc0c7865
comparison
equal deleted inserted replaced
10357:0d64b30b35c3 10358:d42821cd5c96
20 20
21 def parseurl(url, revs=[]): 21 def parseurl(url, revs=[]):
22 '''parse url#branch, returning url, branch + revs''' 22 '''parse url#branch, returning url, branch + revs'''
23 23
24 if '#' not in url: 24 if '#' not in url:
25 return url, (revs or None), revs and revs[-1] or None 25 return url, (revs or None), revs and revs[0] or None
26 26
27 url, branch = url.split('#', 1) 27 url, branch = url.split('#', 1)
28 checkout = revs and revs[-1] or branch 28 checkout = revs and revs[0] or branch
29 return url, (revs or []) + [branch], checkout 29 return url, (revs or []) + [branch], checkout
30 30
31 schemes = { 31 schemes = {
32 'bundle': bundlerepo, 32 'bundle': bundlerepo,
33 'file': _local, 33 'file': _local,
186 source, rev, checkout = parseurl(origsource, rev) 186 source, rev, checkout = parseurl(origsource, rev)
187 src_repo = repository(ui, source) 187 src_repo = repository(ui, source)
188 else: 188 else:
189 src_repo = source 189 src_repo = source
190 origsource = source = src_repo.url() 190 origsource = source = src_repo.url()
191 checkout = rev and rev[-1] or None 191 checkout = rev and rev[0] or None
192 192
193 if dest is None: 193 if dest is None:
194 dest = defaultdest(source) 194 dest = defaultdest(source)
195 ui.status(_("destination directory: %s\n") % dest) 195 ui.status(_("destination directory: %s\n") % dest)
196 else: 196 else: