[MERGE] don't invoke os.rename on children with no contents
Robert Collins
robertc at robertcollins.net
Wed Jun 6 02:35:30 BST 2007
On Tue, 2007-06-05 at 21:10 -0400, Aaron Bentley wrote:
You're good to merge without doing the below.
> That would leave the old limbo name in self._limbo_files, and as soon
> as
> you tried to provide contents for trans_id, TreeTransform would blow
> up
> real good.
>
> Now what you could do is this:
>
> for trans_id in trans_ids:
> 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)
> os.rename(old_path, new_path)
>
> Deleting the self._limbo_files entry forces it to be generated from
> scratch on the next usage, rather than generating it from scratch now.
This is not related to merging - a more general api discussion:
Interesting. Which is it that removes it from _limbo_files? the
_limbo_name call? It just appears hard to guess at whats happening..
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070606/94ce879c/attachment-0001.pgp
More information about the bazaar
mailing list