Mercurial > hg-stable
comparison mercurial/hg.py @ 865:2d2fee33ec68
Cleanup after previous changes:
- there are only two states for the exec bit, so no need to override it.
- file_ variable is only once now, so it self.file(f) can be used directly.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 10 Aug 2005 08:41:23 +0100 |
parents | a7e95e3606c7 |
children | 6d6095823b82 |
comparison
equal
deleted
inserted
replaced
864:6225bd773c51 | 865:2d2fee33ec68 |
---|---|
405 for f in files: | 405 for f in files: |
406 if state == "r": | 406 if state == "r": |
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 st_mode = kw.get('st_mode', s.st_mode) | |
411 st_size = kw.get('st_size', s.st_size) | 410 st_size = kw.get('st_size', s.st_size) |
412 st_mtime = kw.get('st_mtime', s.st_mtime) | 411 st_mtime = kw.get('st_mtime', s.st_mtime) |
413 self.map[f] = (state, st_mode, st_size, st_mtime) | 412 self.map[f] = (state, s.st_mode, st_size, st_mtime) |
414 | 413 |
415 def forget(self, files): | 414 def forget(self, files): |
416 if not files: return | 415 if not files: return |
417 self.read() | 416 self.read() |
418 self.markdirty() | 417 self.markdirty() |
1581 self.dirstate.update([f], mode) | 1580 self.dirstate.update([f], mode) |
1582 elif p2 == nullid: | 1581 elif p2 == nullid: |
1583 # update dirstate from parent1's manifest | 1582 # update dirstate from parent1's manifest |
1584 m1n = self.changelog.read(p1)[0] | 1583 m1n = self.changelog.read(p1)[0] |
1585 m1 = self.manifest.read(m1n) | 1584 m1 = self.manifest.read(m1n) |
1586 file_ = self.file(f) | 1585 f_len = len(self.file(f).read(m1[f])) |
1587 f_len = len(file_.read(m1[f])) | |
1588 self.dirstate.update([f], mode, st_size=f_len, st_mtime=0) | 1586 self.dirstate.update([f], mode, st_size=f_len, st_mtime=0) |
1589 else: | 1587 else: |
1590 self.ui.warn("Second parent without branch merge!?\n" | 1588 self.ui.warn("Second parent without branch merge!?\n" |
1591 "Dirstate for file %s may be wrong.\n" % f) | 1589 "Dirstate for file %s may be wrong.\n" % f) |
1592 | 1590 |