##// 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 def copies(self):
438 def copies(self):
439 return self._map.copymap
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 oldstate = self[f]
450 oldstate = self[f]
443 if state == b'a' or oldstate == b'r':
451 if state == b'a' or oldstate == b'r':
444 scmutil.checkfilename(f)
452 scmutil.checkfilename(f)
@@ -455,10 +463,15 b' class dirstate(object):'
455 msg = _(b'file %r in dirstate clashes with %r')
463 msg = _(b'file %r in dirstate clashes with %r')
456 msg %= (pycompat.bytestr(d), pycompat.bytestr(f))
464 msg %= (pycompat.bytestr(d), pycompat.bytestr(f))
457 raise error.Abort(msg)
465 raise error.Abort(msg)
458 if size != NONNORMAL and size != FROM_P2:
466 if from_p2:
459 size = size & _rangemask
467 size = FROM_P2
460 if mtime != AMBIGUOUS_TIME:
468 mtime = AMBIGUOUS_TIME
461 mtime = mtime & _rangemask
469 else:
470 assert size != FROM_P2
471 if size != NONNORMAL:
472 size = size & _rangemask
473 if mtime != AMBIGUOUS_TIME:
474 mtime = mtime & _rangemask
462 self._dirty = True
475 self._dirty = True
463 self._updatedfiles.add(f)
476 self._updatedfiles.add(f)
464 self._map.addfile(f, oldstate, state, mode, size, mtime)
477 self._map.addfile(f, oldstate, state, mode, size, mtime)
@@ -519,10 +532,10 b' class dirstate(object):'
519 raise error.Abort(msg)
532 raise error.Abort(msg)
520 if f in self and self[f] == b'n':
533 if f in self and self[f] == b'n':
521 # merge-like
534 # merge-like
522 self._addpath(f, b'm', 0, FROM_P2)
535 self._addpath(f, b'm', 0, from_p2=True)
523 else:
536 else:
524 # add-like
537 # add-like
525 self._addpath(f, b'n', 0, FROM_P2)
538 self._addpath(f, b'n', 0, from_p2=True)
526 self._map.copymap.pop(f, None)
539 self._map.copymap.pop(f, None)
527
540
528 def add(self, f):
541 def add(self, f):
General Comments 0
You need to be logged in to leave comments. Login now