##// END OF EJS Templates
normallookup: during merges, restore the state saved by remove
Alexis S. L. Carvalho -
r6298:53cbb33e default
parent child Browse files
Show More
@@ -244,6 +244,21 b' class dirstate(object):'
244 244
245 245 def normallookup(self, f):
246 246 'mark a file normal, but possibly dirty'
247 if self._pl[1] != nullid and f in self._map:
248 # if there is a merge going on and the file was either
249 # in state 'm' or dirty before being removed, restore that state.
250 entry = self._map[f]
251 if entry[0] == 'r' and entry[2] in (-1, -2):
252 source = self._copymap.get(f)
253 if entry[2] == -1:
254 self.merge(f)
255 elif entry[2] == -2:
256 self.normaldirty(f)
257 if source:
258 self.copy(source, f)
259 return
260 if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2:
261 return
247 262 self._dirty = True
248 263 self._changepath(f, 'n', True)
249 264 self._map[f] = ('n', 0, -1, -1, 0)
@@ -22,6 +22,7 b' abort: uncommitted merge - please provid'
22 22 undeleting a
23 23 forgetting b
24 24 %%% should show b unknown and a marked modified (merged)
25 M a
25 26 ? b
26 27 %%% should show foo-b
27 28 foo-b
@@ -27,3 +27,10 b' cp bar B'
27 27 hg rm -f foo1 bar
28 28 hg debugstate --nodates
29 29 hg st -qC
30
31 echo '% readding foo1 and bar'
32 cp F foo1
33 cp B bar
34 hg add -v foo1 bar
35 hg debugstate --nodates
36 hg st -qC
@@ -13,3 +13,12 b' copy: foo -> foo1'
13 13 R bar
14 14 R foo1
15 15 foo
16 % readding foo1 and bar
17 adding bar
18 adding foo1
19 n 0 -2 bar
20 m 644 14 foo1
21 copy: foo -> foo1
22 M bar
23 M foo1
24 foo
General Comments 0
You need to be logged in to leave comments. Login now