Show More
@@ -392,7 +392,7 b' class dirstate:' | |||||
392 | def copied(self, file): |
|
392 | def copied(self, file): | |
393 | return self.copies.get(file, None) |
|
393 | return self.copies.get(file, None) | |
394 |
|
394 | |||
395 | def update(self, files, state): |
|
395 | def update(self, files, state, **kw): | |
396 | ''' current states: |
|
396 | ''' current states: | |
397 | n normal |
|
397 | n normal | |
398 | m needs merging |
|
398 | m needs merging | |
@@ -407,7 +407,10 b' class dirstate:' | |||||
407 | self.map[f] = ('r', 0, 0, 0) |
|
407 | self.map[f] = ('r', 0, 0, 0) | |
408 | else: |
|
408 | else: | |
409 | s = os.stat(os.path.join(self.root, f)) |
|
409 | s = os.stat(os.path.join(self.root, f)) | |
410 | self.map[f] = (state, s.st_mode, s.st_size, s.st_mtime) |
|
410 | st_mode = kw.get('st_mode', s.st_mode) | |
|
411 | st_size = kw.get('st_size', s.st_size) | |||
|
412 | st_mtime = kw.get('st_mtime', s.st_mtime) | |||
|
413 | self.map[f] = (state, st_mode, st_size, st_mtime) | |||
411 |
|
414 | |||
412 | def forget(self, files): |
|
415 | def forget(self, files): | |
413 | if not files: return |
|
416 | if not files: return | |
@@ -1571,10 +1574,21 b' class localrepository:' | |||||
1571 | m, o, flag = merge[f] |
|
1574 | m, o, flag = merge[f] | |
1572 | self.merge3(f, m, o) |
|
1575 | self.merge3(f, m, o) | |
1573 | util.set_exec(self.wjoin(f), flag) |
|
1576 | util.set_exec(self.wjoin(f), flag) | |
1574 |
if moddirstate |
|
1577 | if moddirstate: | |
1575 | # only update dirstate on branch merge, otherwise we |
|
1578 | if mode == 'm': | |
1576 | # could mark files with changes as unchanged |
|
1579 | # only update dirstate on branch merge, otherwise we | |
1577 | self.dirstate.update([f], mode) |
|
1580 | # could mark files with changes as unchanged | |
|
1581 | self.dirstate.update([f], mode) | |||
|
1582 | elif p2 == nullid: | |||
|
1583 | # update dirstate from parent1's manifest | |||
|
1584 | m1n = self.changelog.read(p1)[0] | |||
|
1585 | m1 = self.manifest.read(m1n) | |||
|
1586 | file_ = self.file(f) | |||
|
1587 | f_len = file_.length(file_.rev(m1[f])) | |||
|
1588 | self.dirstate.update([f], mode, st_size=f_len, st_mtime=0) | |||
|
1589 | else: | |||
|
1590 | self.ui.warn("Second parent without branch merge!?\n" | |||
|
1591 | "Dirstate for file %s may be wrong.\n" % f) | |||
1578 |
|
1592 | |||
1579 | remove.sort() |
|
1593 | remove.sort() | |
1580 | for f in remove: |
|
1594 | for f in remove: |
General Comments 0
You need to be logged in to leave comments.
Login now