##// END OF EJS Templates
dirstate: add an explicit `from_p2` parameter to `_addpath`...
marmoute -
r48281:1f571077 default
parent child Browse files
Show More
@@ -438,7 +438,15 b' class dirstate(object):'
438 438 def copies(self):
439 439 return self._map.copymap
440 440
441 def _addpath(self, f, state, mode, size=NONNORMAL, mtime=AMBIGUOUS_TIME):
441 def _addpath(
442 self,
443 f,
444 state,
445 mode,
446 size=NONNORMAL,
447 mtime=AMBIGUOUS_TIME,
448 from_p2=False,
449 ):
442 450 oldstate = self[f]
443 451 if state == b'a' or oldstate == b'r':
444 452 scmutil.checkfilename(f)
@@ -455,7 +463,12 b' class dirstate(object):'
455 463 msg = _(b'file %r in dirstate clashes with %r')
456 464 msg %= (pycompat.bytestr(d), pycompat.bytestr(f))
457 465 raise error.Abort(msg)
458 if size != NONNORMAL and size != FROM_P2:
466 if from_p2:
467 size = FROM_P2
468 mtime = AMBIGUOUS_TIME
469 else:
470 assert size != FROM_P2
471 if size != NONNORMAL:
459 472 size = size & _rangemask
460 473 if mtime != AMBIGUOUS_TIME:
461 474 mtime = mtime & _rangemask
@@ -519,10 +532,10 b' class dirstate(object):'
519 532 raise error.Abort(msg)
520 533 if f in self and self[f] == b'n':
521 534 # merge-like
522 self._addpath(f, b'm', 0, FROM_P2)
535 self._addpath(f, b'm', 0, from_p2=True)
523 536 else:
524 537 # add-like
525 self._addpath(f, b'n', 0, FROM_P2)
538 self._addpath(f, b'n', 0, from_p2=True)
526 539 self._map.copymap.pop(f, None)
527 540
528 541 def add(self, f):
General Comments 0
You need to be logged in to leave comments. Login now