Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 4160:b4bd2f3ea347
localrepo.status: fcmp gets a getnode function instead of the manifest
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 07 Mar 2007 15:25:59 -0300 |
parents | 26596a6b6518 |
children | 939de0d20a67 |
comparison
equal
deleted
inserted
replaced
4159:a896607d3ec3 | 4160:b4bd2f3ea347 |
---|---|
879 | 879 |
880 If node1 is None, use the first dirstate parent instead. | 880 If node1 is None, use the first dirstate parent instead. |
881 If node2 is None, compare node1 with working directory. | 881 If node2 is None, compare node1 with working directory. |
882 """ | 882 """ |
883 | 883 |
884 def fcmp(fn, mf): | 884 def fcmp(fn, getnode): |
885 t1 = self.wread(fn) | 885 t1 = self.wread(fn) |
886 return self.file(fn).cmp(mf.get(fn, nullid), t1) | 886 return self.file(fn).cmp(getnode(fn), t1) |
887 | 887 |
888 def mfmatches(node): | 888 def mfmatches(node): |
889 change = self.changelog.read(node) | 889 change = self.changelog.read(node) |
890 mf = self.manifest.read(change[0]).copy() | 890 mf = self.manifest.read(change[0]).copy() |
891 for fn in mf.keys(): | 891 for fn in mf.keys(): |
920 # are we comparing working dir against its parent? | 920 # are we comparing working dir against its parent? |
921 if compareworking: | 921 if compareworking: |
922 if lookup: | 922 if lookup: |
923 # do a full compare of any files that might have changed | 923 # do a full compare of any files that might have changed |
924 mf2 = mfmatches(self.dirstate.parents()[0]) | 924 mf2 = mfmatches(self.dirstate.parents()[0]) |
925 getnode = lambda fn: mf2.get(fn, nullid) | |
925 for f in lookup: | 926 for f in lookup: |
926 if fcmp(f, mf2): | 927 if fcmp(f, getnode): |
927 modified.append(f) | 928 modified.append(f) |
928 else: | 929 else: |
929 clean.append(f) | 930 clean.append(f) |
930 if wlock is not None: | 931 if wlock is not None: |
931 self.dirstate.update([f], "n") | 932 self.dirstate.update([f], "n") |
952 | 953 |
953 # make sure to sort the files so we talk to the disk in a | 954 # make sure to sort the files so we talk to the disk in a |
954 # reasonable order | 955 # reasonable order |
955 mf2keys = mf2.keys() | 956 mf2keys = mf2.keys() |
956 mf2keys.sort() | 957 mf2keys.sort() |
958 getnode = lambda fn: mf1.get(fn, nullid) | |
957 for fn in mf2keys: | 959 for fn in mf2keys: |
958 if mf1.has_key(fn): | 960 if mf1.has_key(fn): |
959 if mf1.flags(fn) != mf2.flags(fn) or \ | 961 if mf1.flags(fn) != mf2.flags(fn) or \ |
960 (mf1[fn] != mf2[fn] and (mf2[fn] != "" or fcmp(fn, mf1))): | 962 (mf1[fn] != mf2[fn] and (mf2[fn] != "" or |
963 fcmp(fn, getnode))): | |
961 modified.append(fn) | 964 modified.append(fn) |
962 elif list_clean: | 965 elif list_clean: |
963 clean.append(fn) | 966 clean.append(fn) |
964 del mf1[fn] | 967 del mf1[fn] |
965 else: | 968 else: |