Rev 3722: (vila) Fix #272648 by not filtering out '.bzr' when it's not there in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Sep 22 17:12:39 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3722
revision-id: pqm at pqm.ubuntu.com-20080922161236-5q0itgsu3l663gnl
parent: pqm at pqm.ubuntu.com-20080922064555-jayr5evddyn8w7g6
parent: v.ladeuil+lp at free.fr-20080922154144-7coto5c05zzilndm
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-09-22 17:12:36 +0100
message:
  (vila) Fix #272648 by not filtering out '.bzr' when it's not there
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/workingtree_implementations/test_remove.py test_remove.py-20070413183901-rvnp85rtc0q0sclp-1
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3719.1.2
    revision-id: v.ladeuil+lp at free.fr-20080922154144-7coto5c05zzilndm
    parent: v.ladeuil+lp at free.fr-20080922094340-h8e6z4dlu429jnhr
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 272648-rm-dir-before-bzr
    timestamp: Mon 2008-09-22 17:41:44 +0200
    message:
      (vila) Fix #272648 by not filtering out '.bzr' when it's not there
    ------------------------------------------------------------
    revno: 3719.1.1
    revision-id: v.ladeuil+lp at free.fr-20080922094340-h8e6z4dlu429jnhr
    parent: pqm at pqm.ubuntu.com-20080921012105-ote1u11mokjim9ir
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 272648-rm-dir-before-bzr
    timestamp: Mon 2008-09-22 11:43:40 +0200
    message:
      Fix bug #272648 
      
      * bzrlib/tests/workingtree_implementations/test_remove.py:
      (TestRemove.test_remove_file_and_containing_dir): Reproduce bug
      #272648.
      
      * bzrlib/workingtree.py:
      (WorkingTree.walkdirs): Don't try to remove '.bzr' if it's not
      there.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/tests/workingtree_implementations/test_remove.py test_remove.py-20070413183901-rvnp85rtc0q0sclp-1
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'NEWS'
--- a/NEWS	2008-09-22 05:40:13 +0000
+++ b/NEWS	2008-09-22 16:12:36 +0000
@@ -35,6 +35,10 @@
     * ``bzr missing`` now accepts an ``--include-merges`` option.
       (Vincent Ladeuil, #233817)
 
+    * Don't try to filter (internally) '.bzr' from the files to be deleted if
+      it's not there.
+      (Vincent Ladeuil, #272648)
+
     * Fix '_in_buffer' AttributeError when using the -Dhpss debug flag.
       (Andrew Bennetts)
 

=== modified file 'bzrlib/tests/workingtree_implementations/test_remove.py'
--- a/bzrlib/tests/workingtree_implementations/test_remove.py	2008-07-30 07:52:22 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_remove.py	2008-09-22 09:43:40 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007 Canonical Ltd
+# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -327,3 +327,12 @@
         self.failIfExists('config/file')
         self.failIfExists('config')
         tree._validate()
+
+    def test_remove_dir_before_bzr(self):
+        # As per bug #272648. Note that a file must be present in the directory
+        # or the bug doesn't manifest itself.
+        tree = self.get_committed_tree(['.aaa/', '.aaa/file'])
+        tree.remove('.aaa/', keep_files=False)
+        self.failIfExists('.aaa/file')
+        self.failIfExists('.aaa')
+        tree._validate()

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2008-09-05 05:12:35 +0000
+++ b/bzrlib/workingtree.py	2008-09-22 09:43:40 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -2326,7 +2326,8 @@
                     # value.
                     bzrdir_loc = bisect_left(cur_disk_dir_content,
                         ('.bzr', '.bzr'))
-                    if cur_disk_dir_content[bzrdir_loc][0] == '.bzr':
+                    if (bzrdir_loc < len(cur_disk_dir_content)
+                        and cur_disk_dir_content[bzrdir_loc][0] == '.bzr'):
                         # we dont yield the contents of, or, .bzr itself.
                         del cur_disk_dir_content[bzrdir_loc]
             if inv_finished:




More information about the bazaar-commits mailing list