Rev 4812: (andrew) Merge lp:bzr/2.0 into lp:bzr/2.1, including fixes for #337834, in file:///home/pqm/archives/thelove/bzr/2.1/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Feb 12 07:10:40 GMT 2010


At file:///home/pqm/archives/thelove/bzr/2.1/

------------------------------------------------------------
revno: 4812 [merge]
revision-id: pqm at pqm.ubuntu.com-20100212071032-5amr4tw8blyfzy84
parent: pqm at pqm.ubuntu.com-20100211024734-aiture0rgvqnl1dc
parent: andrew.bennetts at canonical.com-20100212062140-m3crv1xgih5pn0ke
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.1
timestamp: Fri 2010-02-12 07:10:32 +0000
message:
  (andrew) Merge lp:bzr/2.0 into lp:bzr/2.1, including fixes for #337834,
  	#368931, and #423563.
added:
  bzrlib/help_topics/en/location-alias.txt locationalias.txt-20100211071747-8cyf9n9xw0j3ypaz-1
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
  bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/per_tree/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
  bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
=== modified file 'NEWS'
--- a/NEWS	2010-02-11 02:47:34 +0000
+++ b/NEWS	2010-02-12 06:21:40 +0000
@@ -315,6 +315,29 @@
   (Martin Pool)
 
 
+bzr 2.0.5 (not released yet)
+############################
+
+:Codename:
+:2.0.5:
+
+Bug Fixes
+*********
+
+* Handle renames correctly when there are files or directories that 
+  differ only in case.  (Chris Jones, Martin Pool, #368931)
+
+* If ``bzr push --create-prefix`` triggers an unexpected ``NoSuchFile``
+  error, report that error rather than failing with an unhelpful
+  ``UnboundLocalError``.
+  (Andrew Bennetts, #423563)
+
+Documentation
+*************
+
+* Added ``location-alias`` help topic.
+  (Andrew Bennetts, #337834)
+
 bzr 2.0.4
 #########
 

=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py	2010-01-20 14:53:08 +0000
+++ b/bzrlib/help_topics/__init__.py	2010-02-12 01:35:24 +0000
@@ -269,6 +269,9 @@
   bzr+ssh://remote@shell.example.com/~/myproject/trunk
 
 would refer to ``/home/remote/myproject/trunk``.
+
+Many commands that accept URLs also accept location aliases too.  See
+::doc:`location-alias-help`.
 """
 
     return out
@@ -758,6 +761,8 @@
                         'Types of conflicts and what to do about them')
 topic_registry.register('debug-flags', _load_from_file,
                         'Options to show or record debug information')
+topic_registry.register('location-alias', _load_from_file,
+                        'Aliases for remembered locations')
 topic_registry.register('log-formats', _load_from_file,
                         'Details on the logging formats available')
 

=== added file 'bzrlib/help_topics/en/location-alias.txt'
--- a/bzrlib/help_topics/en/location-alias.txt	1970-01-01 00:00:00 +0000
+++ b/bzrlib/help_topics/en/location-alias.txt	2010-02-11 07:18:20 +0000
@@ -0,0 +1,19 @@
+Location aliases
+================
+
+Bazaar defines several aliases for locations associated with a branch.  These
+can be used with most commands that expect a location, such as `bzr push`.
+
+The aliases are::
+
+  :parent    the parent of this branch
+  :submit    the submit branch for this branch
+  :public    the public location of this branch
+  :bound     the branch this branch is bound to, for bound branches
+  :push      the saved location used for `bzr push` with no arguments
+  :this      this branch
+
+For example, to push to the parent location::
+
+    bzr push :parent
+

=== modified file 'bzrlib/push.py'
--- a/bzrlib/push.py	2009-12-25 13:47:23 +0000
+++ b/bzrlib/push.py	2010-02-12 01:35:24 +0000
@@ -110,6 +110,12 @@
                     "\nYou may supply --create-prefix to create all"
                     " leading parent directories."
                     % location)
+            # This shouldn't occur (because create_prefix is true, so
+            # create_clone_on_transport should be catching NoSuchFile and
+            # creating the missing directories) but if it does the original
+            # NoSuchFile error will be more informative than an
+            # UnboundLocalError for br_to.
+            raise
         except errors.TooManyRedirections:
             raise errors.BzrCommandError("Too many redirections trying "
                                          "to make %s." % location)

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-02-02 08:36:12 +0000
+++ b/bzrlib/tests/__init__.py	2010-02-12 06:21:40 +0000
@@ -4344,6 +4344,23 @@
 CaseInsensitiveFilesystemFeature = _CaseInsensitiveFilesystemFeature()
 
 
+class _CaseSensitiveFilesystemFeature(Feature):
+
+    def _probe(self):
+        if CaseInsCasePresFilenameFeature.available():
+            return False
+        elif CaseInsensitiveFilesystemFeature.available():
+            return False
+        else:
+            return True
+
+    def feature_name(self):
+        return 'case-sensitive filesystem'
+
+# new coding style is for feature instances to be lowercase
+case_sensitive_filesystem_feature = _CaseSensitiveFilesystemFeature()
+
+
 # Kept for compatibility, use bzrlib.tests.features.subunit instead
 SubUnitFeature = _CompatabilityThunkFeature('bzrlib.tests.features', 'subunit',
     'bzrlib.tests.SubUnitFeature', deprecated_in((2,1,0)))

=== modified file 'bzrlib/tests/per_tree/test_inv.py'
--- a/bzrlib/tests/per_tree/test_inv.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/per_tree/test_inv.py	2010-02-12 03:33:36 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 Canonical Ltd
+# Copyright (C) 2007, 2008, 2010 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
@@ -23,7 +23,10 @@
 from bzrlib import (
     tests,
     )
-from bzrlib.tests import per_tree
+from bzrlib.tests import (
+    features,
+    per_tree,
+    )
 from bzrlib.mutabletree import MutableTree
 from bzrlib.tests import SymlinkFeature, TestSkipped
 from bzrlib.transform import _PreviewTree
@@ -131,6 +134,8 @@
         work_tree.add(['dir', 'dir/file'])
         if commit:
             work_tree.commit('commit 1')
+        # XXX: this isn't actually guaranteed to return the class we want to
+        # test -- mbp 2010-02-12
         return work_tree
 
     def test_canonical_path(self):
@@ -163,3 +168,21 @@
         work_tree = self._make_canonical_test_tree()
         self.assertEqual('dir/None',
                          work_tree.get_canonical_inventory_path('Dir/None'))
+
+    def test_canonical_tree_name_mismatch(self):
+        # see <https://bugs.edge.launchpad.net/bzr/+bug/368931>
+        # some of the trees we want to use can only exist on a disk, not in
+        # memory - therefore we can only test this if the filesystem is
+        # case-sensitive.
+        self.requireFeature(tests.case_sensitive_filesystem_feature)
+        work_tree = self.make_branch_and_tree('.')
+        self.build_tree(['test/', 'test/file', 'Test'])
+        work_tree.add(['test/', 'test/file', 'Test'])
+
+        test_tree = self._convert_tree(work_tree)
+        test_tree.lock_read()
+        self.addCleanup(test_tree.unlock)
+
+        self.assertEqual(['test', 'test/file', 'Test', 'test/foo', 'Test/foo'],
+            test_tree.get_canonical_inventory_paths(
+                ['test', 'test/file', 'Test', 'test/foo', 'Test/foo']))

=== modified file 'bzrlib/tree.py'
--- a/bzrlib/tree.py	2009-11-27 23:21:36 +0000
+++ b/bzrlib/tree.py	2010-02-12 06:21:40 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2009 Canonical Ltd
+# Copyright (C) 2005, 2009, 2010 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
@@ -404,16 +404,34 @@
             bit_iter = iter(path.split("/"))
             for elt in bit_iter:
                 lelt = elt.lower()
+                new_path = None
                 for child in self.iter_children(cur_id):
                     try:
+                        # XXX: it seem like if the child is known to be in the
+                        # tree, we shouldn't need to go from its id back to
+                        # its path -- mbp 2010-02-11
+                        #
+                        # XXX: it seems like we could be more efficient
+                        # by just directly looking up the original name and
+                        # only then searching all children; also by not
+                        # chopping paths so much. -- mbp 2010-02-11
                         child_base = os.path.basename(self.id2path(child))
-                        if child_base.lower() == lelt:
+                        if (child_base == elt):
+                            # if we found an exact match, we can stop now; if
+                            # we found an approximate match we need to keep
+                            # searching because there might be an exact match
+                            # later.  
                             cur_id = child
-                            cur_path = osutils.pathjoin(cur_path, child_base)
+                            new_path = osutils.pathjoin(cur_path, child_base)
                             break
+                        elif child_base.lower() == lelt:
+                            cur_id = child
+                            new_path = osutils.pathjoin(cur_path, child_base)
                     except NoSuchId:
                         # before a change is committed we can see this error...
                         continue
+                if new_path:
+                    cur_path = new_path
                 else:
                     # got to the end of this directory and no entries matched.
                     # Return what matched so far, plus the rest as specified.




More information about the bazaar-commits mailing list