##// END OF EJS Templates
merge with crew-stable
Dirkjan Ochtman -
r7050:67886086 merge default
parent child Browse files
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, rev = url.split('#', 1)
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,
@@ -120,7 +121,7 b' def clone(ui, source, dest=None, pull=Fa'
120 else:
121 else:
121 src_repo = source
122 src_repo = source
122 origsource = source = src_repo.url()
123 origsource = source = src_repo.url()
123 checkout = None
124 checkout = rev and rev[-1] or None
124
125
125 if dest is None:
126 if dest is None:
126 dest = defaultdest(source)
127 dest = defaultdest(source)
@@ -231,12 +232,13 b' def clone(ui, source, dest=None, pull=Fa'
231 dest_repo.ui.status(_("updating working directory\n"))
232 dest_repo.ui.status(_("updating working directory\n"))
232 if update is not True:
233 if update is not True:
233 checkout = update
234 checkout = update
234 elif not checkout:
235 for test in (checkout, 'default', 'tip'):
235 try:
236 try:
236 checkout = dest_repo.lookup("default")
237 uprev = dest_repo.lookup(test)
238 break
237 except:
239 except:
238 checkout = dest_repo.changelog.tip()
240 continue
239 _update(dest_repo, checkout)
241 _update(dest_repo, uprev)
240
242
241 return src_repo, dest_repo
243 return src_repo, dest_repo
242 finally:
244 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: new head of branch foo
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