Rev 2511: Update style of TreeTransform._rename_in_limbo in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Jun 6 06:00:07 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2511
revision-id: pqm at pqm.ubuntu.com-20070606050006-o4yiw7jnwytgf561
parent: pqm at pqm.ubuntu.com-20070606043217-jlt8hu49sk54tsag
parent: aaron.bentley at utoronto.ca-20070606041017-c8wds05ilv5jokkz
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-06-06 06:00:06 +0100
message:
Update style of TreeTransform._rename_in_limbo
modified:
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
------------------------------------------------------------
revno: 2502.1.14
merged: aaron.bentley at utoronto.ca-20070606041017-c8wds05ilv5jokkz
parent: aaron.bentley at utoronto.ca-20070606012818-ubf8cmaj1imntttb
committer: Aaron Bentley <aaron.bentley at utoronto.ca>
branch nick: fast-checkout
timestamp: Wed 2007-06-06 00:10:17 -0400
message:
Style update suggested by Robert
=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py 2007-06-06 01:28:18 +0000
+++ b/bzrlib/transform.py 2007-06-06 04:10:17 +0000
@@ -204,13 +204,15 @@
these files later by creating them with their final names in their
final parents. But now the previous name or parent is no longer
suitable, so we have to rename them.
+
+ Even for trans_ids that have no new contents, we must remove their
+ entries from _limbo_files, because they are now stale.
"""
for trans_id in trans_ids:
+ old_path = self._limbo_files.pop(trans_id)
if trans_id not in self._new_contents:
- del self._limbo_files[trans_id]
continue
- old_path = self._limbo_files[trans_id]
- new_path = self._limbo_name(trans_id, from_scratch=True)
+ new_path = self._limbo_name(trans_id)
os.rename(old_path, new_path)
def adjust_root_path(self, name, parent):
@@ -807,12 +809,11 @@
self.finalize()
return _TransformResults(modified_paths, self.rename_count)
- def _limbo_name(self, trans_id, from_scratch=False):
+ def _limbo_name(self, trans_id):
"""Generate the limbo name of a file"""
- if not from_scratch:
- limbo_name = self._limbo_files.get(trans_id)
- if limbo_name is not None:
- return limbo_name
+ limbo_name = self._limbo_files.get(trans_id)
+ if limbo_name is not None:
+ return limbo_name
parent = self._new_parent.get(trans_id)
# if the parent directory is already in limbo (e.g. when building a
# tree), choose a limbo name inside the parent, to reduce further
More information about the bazaar-commits
mailing list