##// END OF EJS Templates
transplant: recover added/removed files after failed application
Brendan Cully -
r3726:752884db default
parent child Browse files
Show More
@@ -196,12 +196,14 b' class transplanter:'
196 if patchfile:
196 if patchfile:
197 try:
197 try:
198 files = {}
198 files = {}
199 fuzz = patch.patch(patchfile, self.ui, cwd=repo.root,
199 try:
200 files=files)
200 fuzz = patch.patch(patchfile, self.ui, cwd=repo.root,
201 if not files:
201 files=files)
202 self.ui.warn(_('%s: empty changeset') % revlog.hex(node))
202 if not files:
203 return
203 self.ui.warn(_('%s: empty changeset') % revlog.hex(node))
204 files = patch.updatedir(self.ui, repo, files, wlock=wlock)
204 return
205 finally:
206 files = patch.updatedir(self.ui, repo, files, wlock=wlock)
205 if filter:
207 if filter:
206 os.unlink(patchfile)
208 os.unlink(patchfile)
207 except Exception, inst:
209 except Exception, inst:
@@ -67,13 +67,16 b' foo'
67 bar
67 bar
68 baz
68 baz
69 EOF
69 EOF
70 echo toremove > toremove
70 hg ci -Amfoo -d '0 0'
71 hg ci -Amfoo -d '0 0'
71 cat <<EOF > foo
72 cat <<EOF > foo
72 foo2
73 foo2
73 bar2
74 bar2
74 baz2
75 baz2
75 EOF
76 EOF
76 hg ci -mfoo2 -d '0 0'
77 rm toremove
78 echo added > added
79 hg ci -Amfoo2 -d '0 0'
77 echo bar > bar
80 echo bar > bar
78 hg ci -Ambar -d '0 0'
81 hg ci -Ambar -d '0 0'
79 echo bar2 >> bar
82 echo bar2 >> bar
@@ -84,3 +87,4 b" hg ci -mfoobar -d '0 0'"
84 hg transplant 1:3
87 hg transplant 1:3
85 echo merge > foo
88 echo merge > foo
86 hg transplant --continue
89 hg transplant --continue
90 hg locate
@@ -77,16 +77,22 b' applying 4333daefcb15'
77 4333daefcb15 transplanted to 5f42c04e07cc
77 4333daefcb15 transplanted to 5f42c04e07cc
78 % transplant --continue
78 % transplant --continue
79 adding foo
79 adding foo
80 adding toremove
81 adding added
82 removing toremove
80 adding bar
83 adding bar
81 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
84 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
82 applying c029d661401c
85 applying a1e30dd1b8e7
83 foo
86 foo
84 Hunk #1 FAILED at 1.
87 Hunk #1 FAILED at 1.
85 1 out of 1 hunk FAILED -- saving rejects to file foo.rej
88 1 out of 1 hunk FAILED -- saving rejects to file foo.rej
86 patch command failed: exited with status 1
89 patch command failed: exited with status 1
87 abort: Fix up the merge and run hg transplant --continue
90 abort: Fix up the merge and run hg transplant --continue
88 c029d661401c transplanted as 1b09cda4cf1b
91 a1e30dd1b8e7 transplanted as e6d0b5145568
89 applying 67f0722fdc4f
92 applying 1739ac5f6139
90 67f0722fdc4f transplanted to faa04033bb41
93 1739ac5f6139 transplanted to 48f780141a79
91 applying 84c5126bd0d2
94 applying 0282d5fbbe02
92 84c5126bd0d2 transplanted to b35f4019ccc9
95 0282d5fbbe02 transplanted to 821d17b1a3ed
96 added
97 bar
98 foo
General Comments 0
You need to be logged in to leave comments. Login now