##// END OF EJS Templates
patch: keep patching after missing copy source (issue3480)...
Patrick Mezard -
r16813:6d42c797 stable
parent child Browse files
Show More
@@ -1343,8 +1343,17 b' def _applydiff(ui, fp, patcher, backend,'
1343 elif state == 'git':
1343 elif state == 'git':
1344 for gp in values:
1344 for gp in values:
1345 path = pstrip(gp.oldpath)
1345 path = pstrip(gp.oldpath)
1346 data, mode = backend.getfile(path)
1346 try:
1347 store.setfile(path, data, mode)
1347 data, mode = backend.getfile(path)
1348 except IOError, e:
1349 if e.errno != errno.ENOENT:
1350 raise
1351 # The error ignored here will trigger a getfile()
1352 # error in a place more appropriate for error
1353 # handling, and will not interrupt the patching
1354 # process.
1355 else:
1356 store.setfile(path, data, mode)
1348 else:
1357 else:
1349 raise util.Abort(_('unsupported parser state: %s') % state)
1358 raise util.Abort(_('unsupported parser state: %s') % state)
1350
1359
@@ -73,6 +73,53 b' Display rejections:'
73 +c
73 +c
74 +c
74 +c
75
75
76 Test missing renamed file
77
78 $ hg qpop
79 popping changeb
80 patch queue now empty
81 $ hg up -qC 0
82 $ echo a > a
83 $ hg mv b bb
84 $ python ../writelines.py bb 2 'b\n' 10 'a\n' 2 'c\n'
85 $ echo c > c
86 $ hg add a c
87 $ hg qnew changebb
88 $ hg qpop
89 popping changebb
90 patch queue now empty
91 $ hg up -qC 1
92 $ hg qpush
93 applying changebb
94 patching file bb
95 Hunk #1 FAILED at 0
96 Hunk #2 FAILED at 7
97 2 out of 2 hunks FAILED -- saving rejects to file bb.rej
98 b not tracked!
99 patch failed, unable to continue (try -v)
100 patch failed, rejects left in working dir
101 errors during apply, please fix and refresh changebb
102 [2]
103 $ cat a
104 a
105 $ cat c
106 c
107 $ cat bb.rej
108 --- bb
109 +++ bb
110 @@ -1,3 +1,5 @@
111 +b
112 +b
113 a
114 a
115 a
116 @@ -8,3 +10,5 @@
117 a
118 a
119 a
120 +c
121 +c
122
76 $ cd ..
123 $ cd ..
77
124
78
125
General Comments 0
You need to be logged in to leave comments. Login now