##// END OF EJS Templates
Fix income/pull with bundle and -R (issue 820)....
Peter Arrenbrecht -
r5664:da72b4d2 default
parent child Browse files
Show More
@@ -0,0 +1,84 b''
1 #!/bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "mq=" >> $HGRCPATH
5 echo "[defaults]" >> $HGRCPATH
6 echo "log = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
7 echo "heads = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
8 echo "incoming = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
9
10 echo "====== .hgrc"
11 cat $HGRCPATH
12
13 echo "====== Setup main"
14 hg init base
15 cd base
16 echo "One" > one
17 hg add
18 hg ci -m "main: one added."
19 echo "++" >> one
20 hg ci -m "main: one updated."
21
22 echo "====== Bundle main"
23 hg bundle --base=null ../main.hg
24 cd ..
25
26 echo "====== Incoming to fresh repo"
27 hg init fresh
28 echo ">> hg -R fresh incoming main.hg"
29 hg -R fresh incoming main.hg
30 echo ">> hg -R fresh incoming bundle:fresh+main.hg"
31 hg -R fresh incoming bundle:fresh+main.hg
32
33
34 echo "====== Setup queue"
35 cd base
36 hg qinit -c
37 hg qnew -m "patch: two added." two.patch
38 echo two > two
39 hg add
40 hg qrefresh
41 hg qcommit -m "queue: two.patch added."
42 hg qpop -a
43
44 echo "====== Bundle queue"
45 hg -R .hg/patches bundle --base=null ../queue.hgq
46 cd ..
47
48
49 echo "====== Clone base"
50 hg clone base copy
51 cd copy
52 hg qinit -c
53
54 echo "====== Incoming queue bundle"
55 echo ">> hg -R .hg/patches incoming ../queue.hgq"
56 hg -R .hg/patches incoming ../queue.hgq
57
58 echo "====== Pull queue bundle"
59 echo ">> hg -R .hg/patches pull --update ../queue.hgq"
60 hg -R .hg/patches pull --update ../queue.hgq
61 echo ">> hg -R .hg/patches heads"
62 hg -R .hg/patches heads
63 echo ">> hg -R .hg/patches log"
64 hg -R .hg/patches log
65 echo ">> hg qseries"
66 hg qseries
67 cd ..
68
69
70 echo "====== Clone base again"
71 hg clone base copy2
72 cd copy2
73 hg qinit -c
74
75 echo "====== Unbundle queue bundle"
76 echo ">> hg -R .hg/patches unbundle --update ../queue.hgq"
77 hg -R .hg/patches unbundle --update ../queue.hgq
78 echo ">> hg -R .hg/patches heads"
79 hg -R .hg/patches heads
80 echo ">> hg -R .hg/patches log"
81 hg -R .hg/patches log
82 echo ">> hg qseries"
83 hg qseries
84 cd ..
@@ -0,0 +1,68 b''
1 ====== .hgrc
2 [ui]
3 slash = True
4 [defaults]
5 backout = -d "0 0"
6 commit = -d "0 0"
7 debugrawcommit = -d "0 0"
8 tag = -d "0 0"
9 [extensions]
10 mq=
11 [defaults]
12 log = --template "{rev}: {desc}\n"
13 heads = --template "{rev}: {desc}\n"
14 incoming = --template "{rev}: {desc}\n"
15 ====== Setup main
16 adding one
17 ====== Bundle main
18 ====== Incoming to fresh repo
19 >> hg -R fresh incoming main.hg
20 comparing with main.hg
21 0: main: one added.
22 1: main: one updated.
23 >> hg -R fresh incoming bundle:fresh+main.hg
24 comparing with bundle:fresh+main.hg
25 0: main: one added.
26 1: main: one updated.
27 ====== Setup queue
28 adding two
29 Patch queue now empty
30 ====== Bundle queue
31 ====== Clone base
32 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 ====== Incoming queue bundle
34 >> hg -R .hg/patches incoming ../queue.hgq
35 comparing with ../queue.hgq
36 0: queue: two.patch added.
37 ====== Pull queue bundle
38 >> hg -R .hg/patches pull --update ../queue.hgq
39 pulling from ../queue.hgq
40 requesting all changes
41 adding changesets
42 adding manifests
43 adding file changes
44 added 1 changesets with 3 changes to 3 files
45 merging series
46 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
47 >> hg -R .hg/patches heads
48 0: queue: two.patch added.
49 >> hg -R .hg/patches log
50 0: queue: two.patch added.
51 >> hg qseries
52 two.patch
53 ====== Clone base again
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 ====== Unbundle queue bundle
56 >> hg -R .hg/patches unbundle --update ../queue.hgq
57 adding changesets
58 adding manifests
59 adding file changes
60 added 1 changesets with 3 changes to 3 files
61 merging series
62 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 >> hg -R .hg/patches heads
64 0: queue: two.patch added.
65 >> hg -R .hg/patches log
66 0: queue: two.patch added.
67 >> hg qseries
68 two.patch
@@ -256,14 +256,25 b' class bundlerepository(localrepo.localre'
256 def instance(ui, path, create):
256 def instance(ui, path, create):
257 if create:
257 if create:
258 raise util.Abort(_('cannot create new bundle repository'))
258 raise util.Abort(_('cannot create new bundle repository'))
259 parentpath = ui.config("bundle", "mainreporoot", "")
260 if parentpath:
261 # Try to make the full path relative so we get a nice, short URL.
262 # In particular, we don't want temp dir names in test outputs.
263 cwd = os.getcwd()
264 if parentpath == cwd:
265 parentpath = ''
266 else:
267 cwd = os.path.join(cwd,'')
268 if parentpath.startswith(cwd):
269 parentpath = parentpath[len(cwd):]
259 path = util.drop_scheme('file', path)
270 path = util.drop_scheme('file', path)
260 if path.startswith('bundle:'):
271 if path.startswith('bundle:'):
261 path = util.drop_scheme('bundle', path)
272 path = util.drop_scheme('bundle', path)
262 s = path.split("+", 1)
273 s = path.split("+", 1)
263 if len(s) == 1:
274 if len(s) == 1:
264 repopath, bundlename = "", s[0]
275 repopath, bundlename = parentpath, s[0]
265 else:
276 else:
266 repopath, bundlename = s
277 repopath, bundlename = s
267 else:
278 else:
268 repopath, bundlename = '', path
279 repopath, bundlename = parentpath, path
269 return bundlerepository(ui, repopath, bundlename)
280 return bundlerepository(ui, repopath, bundlename)
@@ -331,6 +331,7 b' def _dispatch(ui, args):'
331 try:
331 try:
332 repo = hg.repository(ui, path=path)
332 repo = hg.repository(ui, path=path)
333 ui = repo.ui
333 ui = repo.ui
334 ui.setconfig("bundle", "mainreporoot", repo.root)
334 if not repo.local():
335 if not repo.local():
335 raise util.Abort(_("repository '%s' is not local") % path)
336 raise util.Abort(_("repository '%s' is not local") % path)
336 except hg.RepoError:
337 except hg.RepoError:
@@ -49,6 +49,15 b' hg -R empty rollback'
49 echo "====== Pull full.hg into empty again (using --cwd)"
49 echo "====== Pull full.hg into empty again (using --cwd)"
50 hg --cwd empty pull ../full.hg
50 hg --cwd empty pull ../full.hg
51
51
52 echo "====== Pull full.hg into test (using -R)"
53 hg -R test pull full.hg
54 echo "====== Pull full.hg into empty (using -R)"
55 hg -R empty pull full.hg
56 echo "====== Rollback empty"
57 hg -R empty rollback
58 echo "====== Pull full.hg into empty again (using -R)"
59 hg -R empty pull full.hg
60
52 echo "====== Log -R full.hg in fresh empty"
61 echo "====== Log -R full.hg in fresh empty"
53 rm -r empty
62 rm -r empty
54 hg init empty
63 hg init empty
@@ -47,6 +47,24 b' adding manifests'
47 adding file changes
47 adding file changes
48 added 9 changesets with 7 changes to 4 files (+1 heads)
48 added 9 changesets with 7 changes to 4 files (+1 heads)
49 (run 'hg heads' to see heads, 'hg merge' to merge)
49 (run 'hg heads' to see heads, 'hg merge' to merge)
50 ====== Pull full.hg into test (using -R)
51 pulling from full.hg
52 searching for changes
53 no changes found
54 ====== Pull full.hg into empty (using -R)
55 pulling from full.hg
56 searching for changes
57 no changes found
58 ====== Rollback empty
59 rolling back last transaction
60 ====== Pull full.hg into empty again (using -R)
61 pulling from full.hg
62 requesting all changes
63 adding changesets
64 adding manifests
65 adding file changes
66 added 9 changesets with 7 changes to 4 files (+1 heads)
67 (run 'hg heads' to see heads, 'hg merge' to merge)
50 ====== Log -R full.hg in fresh empty
68 ====== Log -R full.hg in fresh empty
51 changeset: 8:836ac62537ab
69 changeset: 8:836ac62537ab
52 tag: tip
70 tag: tip
General Comments 0
You need to be logged in to leave comments. Login now