##// END OF EJS Templates
pull: with -u and -r, update to the first revision given...
Sune Foldager -
r10358:d42821cd default
parent child Browse files
Show More
@@ -22,10 +22,10 b' 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 = {
@@ -188,7 +188,7 b' def clone(ui, source, dest=None, pull=Fa'
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)
@@ -17,6 +17,11 b' cd copy'
17 echo '% pull a missing revision'
17 echo '% pull a missing revision'
18 hg pull -qr missing ../repo
18 hg pull -qr missing ../repo
19
19
20 echo '% pull multiple revisions with update'
21 hg pull -qu -r 0 -r 1 ../repo
22 hg -q parents
23 hg rollback
24
20 echo '% pull -r 0'
25 echo '% pull -r 0'
21 hg pull -qr 0 ../repo
26 hg pull -qr 0 ../repo
22 hg log
27 hg log
@@ -17,6 +17,9 b' summary: add foo'
17
17
18 % pull a missing revision
18 % pull a missing revision
19 abort: unknown revision 'missing'!
19 abort: unknown revision 'missing'!
20 % pull multiple revisions with update
21 0:bbd179dfa0a7
22 rolling back last transaction
20 % pull -r 0
23 % pull -r 0
21 changeset: 0:bbd179dfa0a7
24 changeset: 0:bbd179dfa0a7
22 tag: tip
25 tag: tip
General Comments 0
You need to be logged in to leave comments. Login now