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