Rev 5423: Merge backup-names into orphan-non-versioned-files in file:///home/vila/src/bzr/bugs/323111-orphans/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 16 10:52:29 BST 2010


At file:///home/vila/src/bzr/bugs/323111-orphans/

------------------------------------------------------------
revno: 5423 [merge]
revision-id: v.ladeuil+lp at free.fr-20100916095229-8fpj6wgs2ya416he
parent: v.ladeuil+lp at free.fr-20100910173646-oxl2s7wy7nhu5psg
parent: v.ladeuil+lp at free.fr-20100916092053-hcbvuhy682c0evgd
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: orphan-non-versioned-files
timestamp: Thu 2010-09-16 11:52:29 +0200
message:
  Merge backup-names into orphan-non-versioned-files
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-10 17:36:46 +0000
+++ b/bzrlib/tests/test_transform.py	2010-09-16 09:52:29 +0000
@@ -822,8 +822,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