Rev 5424: Merge deprecate-get-backup-name into orphan-config-option in file:///home/vila/src/bzr/bugs/323111-orphans/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Sep 16 10:52:33 BST 2010
At file:///home/vila/src/bzr/bugs/323111-orphans/
------------------------------------------------------------
revno: 5424 [merge]
revision-id: v.ladeuil+lp at free.fr-20100916095233-ik3jqalkoig53nbm
parent: v.ladeuil+lp at free.fr-20100916090656-acrq9cza0gi1447f
parent: v.ladeuil+lp at free.fr-20100916095231-heal6mw9ueddsuxy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: orphan-config-option
timestamp: Thu 2010-09-16 11:52:33 +0200
message:
Merge deprecate-get-backup-name into orphan-config-option
modified:
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
-------------- next part --------------
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2010-09-10 14:36:50 +0000
+++ b/bzrlib/bzrdir.py 2010-09-16 09:52:29 +0000
@@ -524,7 +524,10 @@
return self._available_backup_name(base)
def _available_backup_name(self, base):
- """Find a non-existing backup file name based on base."""
+ """Find a non-existing backup file name based on base.
+
+ See bzrlib.osutils.available_backup_name about race conditions.
+ """
return osutils.available_backup_name(base, self.root_transport.has)
def backup_bzrdir(self):
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2010-09-09 20:43:37 +0000
+++ b/bzrlib/osutils.py 2010-09-16 09:52:29 +0000
@@ -2361,10 +2361,12 @@
This will *not* create anything, this only return a 'free' entry. This
should be used for checking names in a directory below a locked
- tree/branch/repo to avoid race conditions.
+ tree/branch/repo to avoid race conditions. This is LBYL (Look Before You
+ Leap) and generally discouraged.
:param base: The base name.
- :param exists: A callable returning True if the passed path exists.
+
+ :param exists: A callable returning True if the path parameter exists.
"""
counter = 1
name = "%s.~%d~" % (base, counter)
=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py 2010-09-16 09:06:56 +0000
+++ b/bzrlib/tests/test_transform.py 2010-09-16 09:52:33 +0000
@@ -823,8 +823,8 @@
parent = tt.trans_id_file_id('parent-id')
tt.new_file('file', parent, 'Contents')
raw_conflicts = resolve_conflicts(tt)
- # Since the directory doesn't exist it's seen as missing to resolve
- # create a conflict asking for it to be created.
+ # Since the directory doesn't exist it's seen as 'missing'. So
+ # 'resolve_conflicts' create a conflict asking for it to be created.
self.assertLength(1, raw_conflicts)
self.assertEqual(('missing parent', 'Created directory', 'new-1'),
raw_conflicts.pop())
More information about the bazaar-commits
mailing list