# HG changeset patch # User Sune Foldager # Date 2010-02-06 19:24:51 # Node ID d42821cd5c96a1c326f581a25673a91b6a50cea7 # Parent 0d64b30b35c308416aeb663359e8b0617f8382b0 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. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -22,10 +22,10 @@ def parseurl(url, revs=[]): '''parse url#branch, returning url, branch + revs''' if '#' not in url: - return url, (revs or None), revs and revs[-1] or None + return url, (revs or None), revs and revs[0] or None url, branch = url.split('#', 1) - checkout = revs and revs[-1] or branch + checkout = revs and revs[0] or branch return url, (revs or []) + [branch], checkout schemes = { @@ -188,7 +188,7 @@ def clone(ui, source, dest=None, pull=Fa else: src_repo = source origsource = source = src_repo.url() - checkout = rev and rev[-1] or None + checkout = rev and rev[0] or None if dest is None: dest = defaultdest(source) diff --git a/tests/test-pull-r b/tests/test-pull-r --- a/tests/test-pull-r +++ b/tests/test-pull-r @@ -17,6 +17,11 @@ cd copy echo '% pull a missing revision' hg pull -qr missing ../repo +echo '% pull multiple revisions with update' +hg pull -qu -r 0 -r 1 ../repo +hg -q parents +hg rollback + echo '% pull -r 0' hg pull -qr 0 ../repo hg log diff --git a/tests/test-pull-r.out b/tests/test-pull-r.out --- a/tests/test-pull-r.out +++ b/tests/test-pull-r.out @@ -17,6 +17,9 @@ summary: add foo % pull a missing revision abort: unknown revision 'missing'! +% pull multiple revisions with update +0:bbd179dfa0a7 +rolling back last transaction % pull -r 0 changeset: 0:bbd179dfa0a7 tag: tip