Show More
@@ -112,7 +112,7 b' elif cmd == "import" or cmd == "patch":' | |||||
112 | repo.commit(files) |
|
112 | repo.commit(files) | |
113 |
|
113 | |||
114 | elif cmd == "status": |
|
114 | elif cmd == "status": | |
115 | (c, a, d) = repo.diffdir(repo.root) |
|
115 | (c, a, d) = repo.diffdir(repo.root, repo.current) | |
116 | for f in c: print "C", f |
|
116 | for f in c: print "C", f | |
117 | for f in a: print "?", f |
|
117 | for f in a: print "?", f | |
118 | for f in d: print "R", f |
|
118 | for f in d: print "R", f | |
@@ -123,7 +123,7 b' elif cmd == "diff":' | |||||
123 | change = repo.changelog.read(repo.current) |
|
123 | change = repo.changelog.read(repo.current) | |
124 | mmap = repo.manifest.read(change[0]) |
|
124 | mmap = repo.manifest.read(change[0]) | |
125 |
|
125 | |||
126 | (c, a, d) = repo.diffdir(repo.root) |
|
126 | (c, a, d) = repo.diffdir(repo.root, repo.current) | |
127 |
|
127 | |||
128 | if args: |
|
128 | if args: | |
129 | nc = [ x for x in c if x in args ] |
|
129 | nc = [ x for x in c if x in args ] | |
@@ -151,7 +151,7 b' elif cmd == "diff":' | |||||
151 | sys.stdout.write(mdiff.unidiff(to, tn, f)) |
|
151 | sys.stdout.write(mdiff.unidiff(to, tn, f)) | |
152 |
|
152 | |||
153 | elif cmd == "addremove": |
|
153 | elif cmd == "addremove": | |
154 | (c, a, d) = repo.diffdir(repo.root) |
|
154 | (c, a, d) = repo.diffdir(repo.root, repo.current) | |
155 | repo.add(a) |
|
155 | repo.add(a) | |
156 | repo.remove(d) |
|
156 | repo.remove(d) | |
157 |
|
157 |
@@ -408,7 +408,7 b' class repository:' | |||||
408 |
|
408 | |||
409 | tr.close() |
|
409 | tr.close() | |
410 |
|
410 | |||
411 | def commit(self, update = None, text = ""): |
|
411 | def commit(self, update = None, parent, text = ""): | |
412 | tr = self.transaction() |
|
412 | tr = self.transaction() | |
413 |
|
413 | |||
414 | try: |
|
414 | try: | |
@@ -419,7 +419,7 b' class repository:' | |||||
419 | remove = [] |
|
419 | remove = [] | |
420 |
|
420 | |||
421 | if update == None: |
|
421 | if update == None: | |
422 | update = self.diffdir(self.root)[0] |
|
422 | update = self.diffdir(self.root, parent)[0] | |
423 |
|
423 | |||
424 | # check in files |
|
424 | # check in files | |
425 | new = {} |
|
425 | new = {} | |
@@ -484,16 +484,25 b' class repository:' | |||||
484 | self.dircache.clear() |
|
484 | self.dircache.clear() | |
485 | self.dircache.update(l) |
|
485 | self.dircache.update(l) | |
486 |
|
486 | |||
487 | def diffdir(self, path): |
|
487 | def diffdir(self, path, changeset): | |
488 | dc = self.dircache.copy() |
|
|||
489 | changed = [] |
|
488 | changed = [] | |
490 | mf = {} |
|
489 | mf = {} | |
491 | added = [] |
|
490 | added = [] | |
492 |
|
491 | |||
493 |
if se |
|
492 | if changeset: | |
494 |
change = self.changelog.read(se |
|
493 | change = self.changelog.read(changeset) | |
495 | mf = self.manifest.read(change[0]) |
|
494 | mf = self.manifest.read(change[0]) | |
496 |
|
495 | |||
|
496 | if changeset == self.current: | |||
|
497 | dc = self.dircache.copy() | |||
|
498 | else: | |||
|
499 | dc = dict.fromkeys(mf) | |||
|
500 | ||||
|
501 | def fcmp(fn): | |||
|
502 | t1 = file(fn).read() | |||
|
503 | t2 = self.file(fn).revision(mf[fn]) | |||
|
504 | return cmp(t1, t2) | |||
|
505 | ||||
497 | for dir, subdirs, files in os.walk(self.root): |
|
506 | for dir, subdirs, files in os.walk(self.root): | |
498 | d = dir[len(self.root)+1:] |
|
507 | d = dir[len(self.root)+1:] | |
499 | if ".hg" in subdirs: subdirs.remove(".hg") |
|
508 | if ".hg" in subdirs: subdirs.remove(".hg") | |
@@ -505,12 +514,13 b' class repository:' | |||||
505 | if fn in dc: |
|
514 | if fn in dc: | |
506 | c = dc[fn] |
|
515 | c = dc[fn] | |
507 | del dc[fn] |
|
516 | del dc[fn] | |
|
517 | if not c: | |||
|
518 | if fcmp(fn): | |||
|
519 | changed.append(fn) | |||
508 | if c[1] != s.st_size: |
|
520 | if c[1] != s.st_size: | |
509 | changed.append(fn) |
|
521 | changed.append(fn) | |
510 | elif c[0] != s.st_mode or c[2] != s.st_mtime: |
|
522 | elif c[0] != s.st_mode or c[2] != s.st_mtime: | |
511 |
|
|
523 | if fcmp(fn): | |
512 | t2 = self.file(fn).revision(mf[fn]) |
|
|||
513 | if t1 != t2: |
|
|||
514 | changed.append(fn) |
|
524 | changed.append(fn) | |
515 | else: |
|
525 | else: | |
516 | if self.ignore(fn): continue |
|
526 | if self.ignore(fn): continue |
General Comments 0
You need to be logged in to leave comments.
Login now