/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Aaron Bentley
  • Date: 2007-12-19 20:19:46 UTC
  • mto: This revision was merged to the branch mainline in revision 3130.
  • Revision ID: abentley@panoramicfeedback.com-20071219201946-stemyt7hujf76w7p
Tweak path handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
829
829
                return path.encode(self.path_encoding, "replace")
830
830
        for (file_id, paths, changed_content, versioned, parent, name, kind,
831
831
             executable) in sorted(iterator, key=changes_key):
 
832
            if parent == (None, None):
 
833
                continue
 
834
            oldpath, newpath = paths
832
835
            oldpath_encoded = get_encoded_path(paths[0])
833
836
            newpath_encoded = get_encoded_path(paths[1])
834
837
            old_present = (kind[0] is not None and versioned[0])
838
841
            if (old_present, new_present) == (True, False):
839
842
                self.to_file.write("=== removed %s '%s'\n" %
840
843
                                   (kind[0], oldpath_encoded))
 
844
                newpath = oldpath
841
845
            elif (old_present, new_present) == (False, True):
842
846
                self.to_file.write("=== added %s '%s'\n" %
843
847
                                   (kind[1], newpath_encoded))
 
848
                oldpath = newpath
844
849
            elif renamed:
845
850
                self.to_file.write("=== renamed %s '%s' => '%s'%s\n" %
846
851
                    (kind[0], oldpath_encoded, newpath_encoded, prop_str))
850
855
                self.to_file.write("=== modified %s '%s'%s\n" % (kind[0],
851
856
                                   newpath_encoded, prop_str))
852
857
            if changed_content:
853
 
                self.diff(file_id, paths[0], paths[1])
 
858
                self.diff(file_id, oldpath, newpath)
854
859
                has_changes = 1
855
860
            if renamed:
856
861
                has_changes = 1