comparison mercurial/hg.py @ 537:411e05b04ffa

Propagate file list through dodiff -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Propagate file list through dodiff This speeds up operations like 'hg diff Makefile'. Previously it would walk the entire directory tree looking for changes. Now it will only stat Makefile. Further, if Makefile appears untouched, it will skip reading the manifest. manifest hash: ab22a70a5511ed2d7a647f2cd15d129a88dccabf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCxNRyywK+sNU5EO8RAgb6AKC2TzWmRjNsWq0Q9Pa+ppCZ6Y+pdwCfdHUA UHu024/2Wt6C6WZ5vcWfPbo= =E35L -----END PGP SIGNATURE-----
author mpm@selenic.com
date Thu, 30 Jun 2005 21:28:18 -0800
parents c15b4bc0a11c
children 4fc63e22b1fe
comparison
equal deleted inserted replaced
536:c15b4bc0a11c 537:411e05b04ffa
304 yield f 304 yield f
305 305
306 # recursive generator of all files listed 306 # recursive generator of all files listed
307 def walk(files): 307 def walk(files):
308 for f in uniq(files): 308 for f in uniq(files):
309 f = os.path.join(self.root, f)
309 if os.path.isdir(f): 310 if os.path.isdir(f):
310 for dir, subdirs, fl in os.walk(f): 311 for dir, subdirs, fl in os.walk(f):
311 d = dir[len(self.root) + 1:] 312 d = dir[len(self.root) + 1:]
312 if ".hg" in subdirs: subdirs.remove(".hg") 313 if ".hg" in subdirs: subdirs.remove(".hg")
313 for fn in fl: 314 for fn in fl:
689 690
690 self.dirstate.setparents(n) 691 self.dirstate.setparents(n)
691 self.dirstate.update(new, "n") 692 self.dirstate.update(new, "n")
692 self.dirstate.forget(remove) 693 self.dirstate.forget(remove)
693 694
694 def changes(self, node1, node2, *files): 695 def changes(self, node1, node2, files=None):
695 # changed, added, deleted, unknown 696 # changed, added, deleted, unknown
696 c, a, d, u, mf1 = [], [], [], [], None 697 c, a, d, u, mf1 = [], [], [], [], None
697 698
698 def fcmp(fn, mf): 699 def fcmp(fn, mf):
699 t1 = self.wfile(fn).read() 700 t1 = self.wfile(fn).read()