##// END OF EJS Templates
dirstate: more explicit name, rename normaldirty() to otherparent()
Benoit Boissinot -
r10968:7a0d096e default
parent child Browse files
Show More
@@ -285,14 +285,15 b' class dirstate(object):'
285 285 '''Mark a file normal, but possibly dirty.'''
286 286 if self._pl[1] != nullid and f in self._map:
287 287 # if there is a merge going on and the file was either
288 # in state 'm' or dirty before being removed, restore that state.
288 # in state 'm' (-1) or coming from other parent (-2) before
289 # being removed, restore that state.
289 290 entry = self._map[f]
290 291 if entry[0] == 'r' and entry[2] in (-1, -2):
291 292 source = self._copymap.get(f)
292 293 if entry[2] == -1:
293 294 self.merge(f)
294 295 elif entry[2] == -2:
295 self.normaldirty(f)
296 self.otherparent(f)
296 297 if source:
297 298 self.copy(source, f)
298 299 return
@@ -304,8 +305,11 b' class dirstate(object):'
304 305 if f in self._copymap:
305 306 del self._copymap[f]
306 307
307 def normaldirty(self, f):
308 '''Mark a file normal, but dirty.'''
308 def otherparent(self, f):
309 '''Mark as coming from the other parent, always dirty.'''
310 if self._pl[1] == nullid:
311 raise util.Abort(_("setting %r to other parent "
312 "only allowed in merges") % f)
309 313 self._dirty = True
310 314 self._addpath(f)
311 315 self._map[f] = ('n', 0, -2, -1)
@@ -326,10 +330,11 b' class dirstate(object):'
326 330 self._droppath(f)
327 331 size = 0
328 332 if self._pl[1] != nullid and f in self._map:
333 # backup the previous state
329 334 entry = self._map[f]
330 if entry[0] == 'm':
335 if entry[0] == 'm': # merge
331 336 size = -1
332 elif entry[0] == 'n' and entry[2] == -2:
337 elif entry[0] == 'n' and entry[2] == -2: # other parent
333 338 size = -2
334 339 self._map[f] = ('r', 0, size, 0)
335 340 if size == 0 and f in self._copymap:
@@ -638,7 +643,7 b' class dirstate(object):'
638 643 if (size >= 0 and
639 644 (size != st.st_size
640 645 or ((mode ^ st.st_mode) & 0100 and self._checkexec))
641 or size == -2
646 or size == -2 # other parent
642 647 or fn in self._copymap):
643 648 madd(fn)
644 649 elif time != int(st.st_mtime):
@@ -364,7 +364,7 b' def recordupdates(repo, action, branchme'
364 364 repo.dirstate.normallookup(f)
365 365 elif m == "g": # get
366 366 if branchmerge:
367 repo.dirstate.normaldirty(f)
367 repo.dirstate.otherparent(f)
368 368 else:
369 369 repo.dirstate.normal(f)
370 370 elif m == "m": # merge
@@ -507,8 +507,8 b' def update(repo, node, branchmerge, forc'
507 507 stats = applyupdates(repo, action, wc, p2)
508 508
509 509 if not partial:
510 repo.dirstate.setparents(fp1, fp2)
510 511 recordupdates(repo, action, branchmerge)
511 repo.dirstate.setparents(fp1, fp2)
512 512 if not branchmerge and not fastforward:
513 513 repo.dirstate.setbranch(p2.branch())
514 514 finally:
General Comments 0
You need to be logged in to leave comments. Login now