/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/transform.py

  • Committer: Martin Pool
  • Date: 2009-07-13 01:46:23 UTC
  • mfrom: (4526 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4528.
  • Revision ID: mbp@sourcefrog.net-20090713014623-w9z54opuyrqgnni0
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
995
995
                       self._new_contents.iteritems()]
996
996
            entries.sort(reverse=True)
997
997
            for path, trans_id, kind in entries:
998
 
                if kind == "directory":
999
 
                    os.rmdir(path)
1000
 
                else:
1001
 
                    os.unlink(path)
 
998
                delete_any(path)
1002
999
            try:
1003
 
                os.rmdir(self._limbodir)
 
1000
                delete_any(self._limbodir)
1004
1001
            except OSError:
1005
1002
                # We don't especially care *why* the dir is immortal.
1006
1003
                raise ImmortalLimbo(self._limbodir)
1007
1004
            try:
1008
1005
                if self._deletiondir is not None:
1009
 
                    os.rmdir(self._deletiondir)
 
1006
                    delete_any(self._deletiondir)
1010
1007
            except OSError:
1011
1008
                raise errors.ImmortalPendingDeletion(self._deletiondir)
1012
1009
        finally:
1965
1962
            return old_annotation
1966
1963
        if not changed_content:
1967
1964
            return old_annotation
 
1965
        # TODO: This is doing something similar to what WT.annotate_iter is
 
1966
        #       doing, however it fails slightly because it doesn't know what
 
1967
        #       the *other* revision_id is, so it doesn't know how to give the
 
1968
        #       other as the origin for some lines, they all get
 
1969
        #       'default_revision'
 
1970
        #       It would be nice to be able to use the new Annotator based
 
1971
        #       approach, as well.
1968
1972
        return annotate.reannotate([old_annotation],
1969
1973
                                   self.get_file(file_id).readlines(),
1970
1974
                                   default_revision)