~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-07-08 02:53:13 UTC
  • Revision ID: mbp@sourcefrog.net-20050708025313-cfa59ec38b152b30
- cleaner 'modified 'command

Show diffs side-by-side

added added

removed removed

Lines of Context:
771
771
    hidden = True
772
772
    def run(self):
773
773
        from bzrlib.statcache import update_cache, SC_SHA1
 
774
        from bzrlib.diff import compare_trees
 
775
 
774
776
        b = find_branch('.')
775
 
        inv = b.read_working_inventory()
776
 
        sc = update_cache(b, inv)
777
 
        basis = b.basis_tree()
778
 
        basis_inv = basis.inventory
779
 
        
780
 
        # We used to do this through iter_entries(), but that's slow
781
 
        # when most of the files are unmodified, as is usually the
782
 
        # case.  So instead we iterate by inventory entry, and only
783
 
        # calculate paths as necessary.
 
777
        td = compare_trees(b.basis_tree(), b.working_tree())
784
778
 
785
 
        for file_id in basis_inv:
786
 
            cacheentry = sc.get(file_id)
787
 
            if not cacheentry:                 # deleted
788
 
                continue
789
 
            ie = basis_inv[file_id]
790
 
            if cacheentry[SC_SHA1] != ie.text_sha1:
791
 
                path = inv.id2path(file_id)
792
 
                print path
 
779
        for path, id, kind in td.modified:
 
780
            print path
793
781
 
794
782
 
795
783