Show More
@@ -0,0 +1,23 b'' | |||||
|
1 | echo % initialize remote repo with branches | |||
|
2 | hg init remote | |||
|
3 | cd remote | |||
|
4 | echo a > a | |||
|
5 | hg ci -Ama | |||
|
6 | hg branch br | |||
|
7 | hg ci -Amb | |||
|
8 | echo c > c | |||
|
9 | hg ci -Amc | |||
|
10 | hg log | |||
|
11 | ||||
|
12 | cd .. | |||
|
13 | echo % try cloning -r branch | |||
|
14 | hg clone -rbr remote local1 | |||
|
15 | hg -R local1 parents | |||
|
16 | ||||
|
17 | echo % try cloning -rother clone#branch | |||
|
18 | hg clone -r0 remote#br local2 | |||
|
19 | hg -R local2 parents | |||
|
20 | ||||
|
21 | echo % try cloning -r1 clone#branch | |||
|
22 | hg clone -r1 remote#br local3 | |||
|
23 | hg -R local3 parents |
@@ -0,0 +1,64 b'' | |||||
|
1 | % initialize remote repo with branches | |||
|
2 | adding a | |||
|
3 | marked working directory as branch br | |||
|
4 | adding c | |||
|
5 | changeset: 2:1630aed6ed2b | |||
|
6 | branch: br | |||
|
7 | tag: tip | |||
|
8 | user: test | |||
|
9 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
10 | summary: c | |||
|
11 | ||||
|
12 | changeset: 1:234f53e6c5ff | |||
|
13 | branch: br | |||
|
14 | user: test | |||
|
15 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
16 | summary: b | |||
|
17 | ||||
|
18 | changeset: 0:cb9a9f314b8b | |||
|
19 | user: test | |||
|
20 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
21 | summary: a | |||
|
22 | ||||
|
23 | % try cloning -r branch | |||
|
24 | requesting all changes | |||
|
25 | adding changesets | |||
|
26 | adding manifests | |||
|
27 | adding file changes | |||
|
28 | added 3 changesets with 2 changes to 2 files | |||
|
29 | updating working directory | |||
|
30 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
31 | changeset: 2:1630aed6ed2b | |||
|
32 | branch: br | |||
|
33 | tag: tip | |||
|
34 | user: test | |||
|
35 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
36 | summary: c | |||
|
37 | ||||
|
38 | % try cloning -rother clone#branch | |||
|
39 | requesting all changes | |||
|
40 | adding changesets | |||
|
41 | adding manifests | |||
|
42 | adding file changes | |||
|
43 | added 3 changesets with 2 changes to 2 files | |||
|
44 | updating working directory | |||
|
45 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
46 | changeset: 0:cb9a9f314b8b | |||
|
47 | user: test | |||
|
48 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
49 | summary: a | |||
|
50 | ||||
|
51 | % try cloning -r1 clone#branch | |||
|
52 | requesting all changes | |||
|
53 | adding changesets | |||
|
54 | adding manifests | |||
|
55 | adding file changes | |||
|
56 | added 3 changesets with 2 changes to 2 files | |||
|
57 | updating working directory | |||
|
58 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
59 | changeset: 1:234f53e6c5ff | |||
|
60 | branch: br | |||
|
61 | user: test | |||
|
62 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
63 | summary: b | |||
|
64 |
@@ -20,10 +20,11 b' def parseurl(url, revs):' | |||||
20 | '''parse url#branch, returning url, branch + revs''' |
|
20 | '''parse url#branch, returning url, branch + revs''' | |
21 |
|
21 | |||
22 | if '#' not in url: |
|
22 | if '#' not in url: | |
23 | return url, (revs or None), None |
|
23 | return url, (revs or None), revs and revs[-1] or None | |
24 |
|
24 | |||
25 |
url, |
|
25 | url, branch = url.split('#', 1) | |
26 | return url, revs + [rev], rev |
|
26 | checkout = revs and revs[-1] or branch | |
|
27 | return url, revs + [branch], checkout | |||
27 |
|
28 | |||
28 | schemes = { |
|
29 | schemes = { | |
29 | 'bundle': bundlerepo, |
|
30 | 'bundle': bundlerepo, | |
@@ -110,7 +111,7 b' def clone(ui, source, dest=None, pull=Fa' | |||||
110 | else: |
|
111 | else: | |
111 | src_repo = source |
|
112 | src_repo = source | |
112 | origsource = source = src_repo.url() |
|
113 | origsource = source = src_repo.url() | |
113 | checkout = None |
|
114 | checkout = rev and rev[-1] or None | |
114 |
|
115 | |||
115 | if dest is None: |
|
116 | if dest is None: | |
116 | dest = defaultdest(source) |
|
117 | dest = defaultdest(source) | |
@@ -245,12 +246,13 b' def clone(ui, source, dest=None, pull=Fa' | |||||
245 |
|
246 | |||
246 | if update: |
|
247 | if update: | |
247 | dest_repo.ui.status(_("updating working directory\n")) |
|
248 | dest_repo.ui.status(_("updating working directory\n")) | |
248 |
|
|
249 | for test in (checkout, 'default', 'tip'): | |
249 | try: |
|
250 | try: | |
250 |
|
|
251 | uprev = dest_repo.lookup(test) | |
|
252 | break | |||
251 | except: |
|
253 | except: | |
252 |
c |
|
254 | continue | |
253 |
_update(dest_repo, |
|
255 | _update(dest_repo, uprev) | |
254 |
|
256 | |||
255 | return src_repo, dest_repo |
|
257 | return src_repo, dest_repo | |
256 | finally: |
|
258 | finally: |
@@ -109,11 +109,12 b' 0:1f0dee641bb7' | |||||
109 | 1:cd2a86ecc814 |
|
109 | 1:cd2a86ecc814 | |
110 | % pull -u -r otherrev url#rev updates to rev |
|
110 | % pull -u -r otherrev url#rev updates to rev | |
111 | % parents |
|
111 | % parents | |
112 | changeset: 2:faba9097cad4 |
|
112 | changeset: 3:4cd725637392 | |
113 | branch: foo |
|
113 | tag: tip | |
|
114 | parent: 0:1f0dee641bb7 | |||
114 | user: test |
|
115 | user: test | |
115 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
116 | date: Thu Jan 01 00:00:00 1970 +0000 | |
116 |
summary: |
|
117 | summary: add bar | |
117 |
|
118 | |||
118 | % heads |
|
119 | % heads | |
119 | changeset: 3:4cd725637392 |
|
120 | changeset: 3:4cd725637392 |
General Comments 0
You need to be logged in to leave comments.
Login now