Rev 5662: (jelmer) Add a WorkingTreeFormat.missing_parent_conflicts flag. (Jelmer in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Feb 12 13:59:46 UTC 2011


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

------------------------------------------------------------
revno: 5662 [merge]
revision-id: pqm at pqm.ubuntu.com-20110212135944-g60tp8iryf0m620i
parent: pqm at pqm.ubuntu.com-20110211171235-ky1uu0l0gz6501g7
parent: jelmer at samba.org-20110211175856-alncdirjmi75qr67
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2011-02-12 13:59:44 +0000
message:
  (jelmer) Add a WorkingTreeFormat.missing_parent_conflicts flag. (Jelmer
   Vernooij)
modified:
  bzrlib/tests/per_workingtree/test_pull.py test_pull.py-20060222044334-43594dd8e143b708
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
=== modified file 'bzrlib/tests/per_workingtree/test_pull.py'
--- a/bzrlib/tests/per_workingtree/test_pull.py	2010-10-15 14:21:03 +0000
+++ b/bzrlib/tests/per_workingtree/test_pull.py	2011-02-11 17:58:56 +0000
@@ -15,7 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-from cStringIO import StringIO
 
 from bzrlib import tests
 from bzrlib.tests import per_workingtree
@@ -85,10 +84,10 @@
         return builder.get_branch()
 
     def test_pull_orphans(self):
-        from bzrlib import workingtree
-        if isinstance(self.workingtree_format, workingtree.WorkingTreeFormat2):
+        if not self.workingtree_format.missing_parent_conflicts:
             raise tests.TestSkipped(
-                'WorkingTreeFormat2 does not support missing parent conflicts')
+                '%r does not support missing parent conflicts' %
+                    self.workingtree_format)
         trunk = self.make_branch_deleting_dir('trunk')
         work = trunk.bzrdir.sprout('work', revision_id='2').open_workingtree()
         work.branch.get_config().set_user_option(

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2011-02-07 14:00:50 +0000
+++ b/bzrlib/workingtree.py	2011-02-11 17:58:56 +0000
@@ -2893,6 +2893,9 @@
 
     case_sensitive_filename = "FoRMaT"
 
+    missing_parent_conflicts = False
+    """If this format supports missing parent conflicts."""
+
     @classmethod
     def find_format(klass, a_bzrdir):
         """Return the format for the working tree object in a_bzrdir."""
@@ -2979,6 +2982,8 @@
 
     case_sensitive_filename = "Branch-FoRMaT"
 
+    missing_parent_conflicts = False
+
     def get_format_description(self):
         """See WorkingTreeFormat.get_format_description()."""
         return "Working tree format 2"
@@ -3069,6 +3074,8 @@
 
     upgrade_recommended = True
 
+    missing_parent_conflicts = True
+
     def get_format_string(self):
         """See WorkingTreeFormat.get_format_string()."""
         return "Bazaar-NG Working Tree format 3"

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2011-01-25 23:21:46 +0000
+++ b/bzrlib/workingtree_4.py	2011-02-11 17:58:56 +0000
@@ -1406,6 +1406,8 @@
 
 class DirStateWorkingTreeFormat(WorkingTreeFormat3):
 
+    missing_parent_conflicts = True
+
     def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
                    accelerator_tree=None, hardlink=False):
         """See WorkingTreeFormat.initialize().




More information about the bazaar-commits mailing list