Show More
@@ -37,7 +37,7 b' def dodiff(ui, repo, files = None, node1' | |||
|
37 | 37 | def date(c): |
|
38 | 38 | return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) |
|
39 | 39 | |
|
40 |
(c, a, d, u) = repo.changes( |
|
|
40 | (c, a, d, u) = repo.changes(node1, node2, files) | |
|
41 | 41 | if files: |
|
42 | 42 | c, a, d = map(lambda x: filterfiles(files, x), (c, a, d)) |
|
43 | 43 |
@@ -95,7 +95,7 b' class manifest(revlog):' | |||
|
95 | 95 | def read(self, node): |
|
96 | 96 | if node == nullid: return {} # don't upset local cache |
|
97 | 97 | if self.mapcache and self.mapcache[0] == node: |
|
98 |
return self.mapcache[1] |
|
|
98 | return self.mapcache[1] | |
|
99 | 99 | text = self.revision(node) |
|
100 | 100 | map = {} |
|
101 | 101 | flag = {} |
@@ -687,7 +687,7 b' class localrepository:' | |||
|
687 | 687 | |
|
688 | 688 | def changes(self, node1, node2, files=None): |
|
689 | 689 | # changed, added, deleted, unknown |
|
690 |
c, a, d, u, mf |
|
|
690 | c, a, d, u, mf2 = [], [], [], [], None | |
|
691 | 691 | |
|
692 | 692 | def fcmp(fn, mf): |
|
693 | 693 | t1 = self.wfile(fn).read() |
@@ -695,48 +695,54 b' class localrepository:' | |||
|
695 | 695 | return cmp(t1, t2) |
|
696 | 696 | |
|
697 | 697 | # are we comparing the working directory? |
|
698 |
if not node |
|
|
698 | if not node2: | |
|
699 | 699 | l, c, a, d, u = self.dirstate.changes(files, self.ignore) |
|
700 | 700 | |
|
701 | 701 | # are we comparing working dir against its parent? |
|
702 |
if not node |
|
|
702 | if not node1: | |
|
703 | 703 | if l: |
|
704 | 704 | # do a full compare of any files that might have changed |
|
705 | 705 | change = self.changelog.read(self.dirstate.parents()[0]) |
|
706 |
mf |
|
|
706 | mf2 = self.manifest.read(change[0]) | |
|
707 | 707 | for f in l: |
|
708 |
if fcmp(f, mf |
|
|
708 | if fcmp(f, mf2): | |
|
709 | 709 | c.append(f) |
|
710 | ||
|
711 | for l in c, a, d, u: | |
|
712 | l.sort() | |
|
713 | ||
|
710 | 714 | return (c, a, d, u) |
|
711 | 715 | |
|
712 | 716 | # are we comparing working dir against non-tip? |
|
713 | 717 | # generate a pseudo-manifest for the working dir |
|
714 |
if not node |
|
|
715 |
if not mf |
|
|
718 | if not node2: | |
|
719 | if not mf2: | |
|
716 | 720 | change = self.changelog.read(self.dirstate.parents()[0]) |
|
717 |
mf |
|
|
721 | mf2 = self.manifest.read(change[0]).copy() | |
|
718 | 722 | for f in a + c + l: |
|
719 |
mf |
|
|
723 | mf2[f] = "" | |
|
720 | 724 | for f in d: |
|
721 |
if f in mf |
|
|
725 | if f in mf2: del mf2[f] | |
|
722 | 726 | else: |
|
723 | change = self.changelog.read(node1) | |
|
724 | mf1 = self.manifest.read(change[0]) | |
|
725 | ||
|
726 | 727 | change = self.changelog.read(node2) |
|
727 | 728 | mf2 = self.manifest.read(change[0]) |
|
728 | 729 | |
|
730 | change = self.changelog.read(node1) | |
|
731 | mf1 = self.manifest.read(change[0]).copy() | |
|
732 | ||
|
729 | 733 | for fn in mf2: |
|
730 | 734 | if mf1.has_key(fn): |
|
731 | 735 | if mf1[fn] != mf2[fn]: |
|
732 |
if mf |
|
|
736 | if mf2[fn] != "" or fcmp(fn, mf1): | |
|
733 | 737 | c.append(fn) |
|
734 | 738 | del mf1[fn] |
|
735 | 739 | else: |
|
736 | 740 | a.append(fn) |
|
737 | 741 | |
|
738 | 742 | d = mf1.keys() |
|
739 | d.sort() | |
|
743 | ||
|
744 | for l in c, a, d, u: | |
|
745 | l.sort() | |
|
740 | 746 | |
|
741 | 747 | return (c, a, d, u) |
|
742 | 748 |
General Comments 0
You need to be logged in to leave comments.
Login now