Rev 1968: merge 0.4. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Sun Nov 9 20:20:34 GMT 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1968
revision-id: jelmer at samba.org-20081109202031-84mnkdx23cmi40va
parent: jelmer at samba.org-20081109181753-3phxrboa09sz3hmj
parent: jelmer at samba.org-20081109200134-l6faemxkza9n5t35
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2008-11-09 21:20:31 +0100
message:
  merge 0.4.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  revids.py                      revids.py-20070416220458-36vfa0730cchevp1-1
    ------------------------------------------------------------
    revno: 1669.9.16
    revision-id: jelmer at samba.org-20081109200134-l6faemxkza9n5t35
    parent: jelmer at samba.org-20081109195807-mducpprmvql5gbju
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 21:01:34 +0100
    message:
      Fix erroneous call to __init__.
    modified:
      NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
      mapping3/__init__.py           __init__.py-20080502174630-9324zh25kka98vlw-1
    ------------------------------------------------------------
    revno: 1669.9.15
    revision-id: jelmer at samba.org-20081109195807-mducpprmvql5gbju
    parent: jelmer at samba.org-20081109195639-ei0pa55kxkfdo1h6
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 20:58:07 +0100
    message:
      Use find_new_lines when finding revision ids.
    modified:
      revids.py                      revids.py-20070416220458-36vfa0730cchevp1-1
    ------------------------------------------------------------
    revno: 1669.9.14
    revision-id: jelmer at samba.org-20081109195639-ei0pa55kxkfdo1h6
    parent: jelmer at samba.org-20081109183314-hotooz35p7sapkej
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 20:56:39 +0100
    message:
      Add some tests for find_new_lines.
    modified:
      tests/test_mapping.py          test_mapping.py-20080201131338-0zd86eznn4bojtee-1
    ------------------------------------------------------------
    revno: 1669.9.13
    revision-id: jelmer at samba.org-20081109183314-hotooz35p7sapkej
    parent: jelmer at samba.org-20081109164122-e48e1e7ka277ef8l
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 19:33:14 +0100
    message:
      Cope with file properties being modified by other parties than bzr-svn.
    modified:
      NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
      fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
      mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
    ------------------------------------------------------------
    revno: 1669.9.12
    revision-id: jelmer at samba.org-20081109164122-e48e1e7ka277ef8l
    parent: jelmer at samba.org-20081109050606-uw85yrmemewf60ve
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 17:41:22 +0100
    message:
      Fix remaining tests.
    modified:
      tests/test_mapping.py          test_mapping.py-20080201131338-0zd86eznn4bojtee-1
    ------------------------------------------------------------
    revno: 1669.9.11
    revision-id: jelmer at samba.org-20081109050606-uw85yrmemewf60ve
    parent: jelmer at samba.org-20081109044042-fsf9qv3j1zlpiqn0
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 06:06:06 +0100
    message:
      Cope with new changed file properties return format.
    modified:
      fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
      mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
      repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
      revids.py                      revids.py-20070416220458-36vfa0730cchevp1-1
      tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
    ------------------------------------------------------------
    revno: 1669.9.10
    revision-id: jelmer at samba.org-20081109044042-fsf9qv3j1zlpiqn0
    parent: jelmer at samba.org-20081109043322-jvzof2b0j6a9klmg
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 05:40:42 +0100
    message:
      Make branchprop code return old property values as well.
    modified:
      branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
      tests/test_branchprops.py      test_branchprops.py-20061223210444-04xf5224zcg69m3w-1
    ------------------------------------------------------------
    revno: 1669.9.9
    revision-id: jelmer at samba.org-20081109043322-jvzof2b0j6a9klmg
    parent: jelmer at samba.org-20081108211128-azi6ujhluh03qe7w
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-11-09 05:33:22 +0100
    message:
      Add test case demonstrating bug 295284.
    modified:
      repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
      tests/test_repository.py       test_repos.py-20060508151940-ddc49a59257ca712
    ------------------------------------------------------------
    revno: 1669.9.8
    revision-id: jelmer at samba.org-20081108211128-azi6ujhluh03qe7w
    parent: jelmer at samba.org-20081108205443-bljnvkxv54uoin8z
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-11-08 22:11:28 +0100
    message:
      Fix knit corruption because text revisions weren't stored correctly.
    modified:
      NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
      versionedfiles.py              versionedfiles.py-20080626134117-j8g0ntz1pj228iox-1
    ------------------------------------------------------------
    revno: 1669.9.7
    revision-id: jelmer at samba.org-20081108205443-bljnvkxv54uoin8z
    parent: jelmer at samba.org-20081108200202-kplsv702oazebfu9
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-11-08 21:54:43 +0100
    message:
      Fix more tests.
    modified:
      fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
      mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
      tests/test_mapping.py          test_mapping.py-20080201131338-0zd86eznn4bojtee-1
      tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
    ------------------------------------------------------------
    revno: 1669.9.6
    revision-id: jelmer at samba.org-20081108200202-kplsv702oazebfu9
    parent: jelmer at samba.org-20081108181139-rirv83qgy4wyu6nd
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-11-08 21:02:02 +0100
    message:
      initial work handling knit corruption because of incorrect text parents.
    modified:
      commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
      fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
      fileids.py                     fileids.py-20060714013623-u5iiyqqnko11grcf-1
      mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
      mapping3/__init__.py           __init__.py-20080502174630-9324zh25kka98vlw-1
    ------------------------------------------------------------
    revno: 1669.9.5
    revision-id: jelmer at samba.org-20081108181139-rirv83qgy4wyu6nd
    parent: jelmer at samba.org-20081108180540-1grspvd20lflzj0r
    parent: jelmer at samba.org-20081105190148-5wu9jr0p4dwt00q0
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-11-08 19:11:39 +0100
    message:
      Merge upstream.
    modified:
      repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'NEWS'
--- a/NEWS	2008-11-08 15:58:46 +0000
+++ b/NEWS	2008-11-09 20:20:31 +0000
@@ -70,6 +70,13 @@
 
    * Support copying from files with spaces in their names over http. (#268304)
 
+   * Fix knit corruption because text revisions weren't stored properly. (#277043)
+
+   * Cope with file properties being modified by other parties than 
+     bzr-svn. (#295284)
+
+   * Fix erroneous call to object.__init__() causing issues with Python2.6.
+
 bzr-svn 0.4.14	2008-11-03
 
   BUG FIXES

=== modified file 'fetch.py'
--- a/fetch.py	2008-11-09 18:17:53 +0000
+++ b/fetch.py	2008-11-09 20:20:31 +0000
@@ -100,12 +100,6 @@
         return self._open_directory(path, base_revnum)
 
     def change_prop(self, name, value):
-        if self.path == "":
-            # Replay lazy_dict, since it may be more expensive
-            if type(self.editor.revmeta._changed_fileprops) != dict:
-                self.editor.revmeta._changed_fileprops = {}
-            self.editor.revmeta._changed_fileprops[name] = (None, value)
-
         if name in (properties.PROP_ENTRY_COMMITTED_DATE,
                     properties.PROP_ENTRY_COMMITTED_REV,
                     properties.PROP_ENTRY_LAST_AUTHOR,
@@ -329,7 +323,7 @@
         if text_parents is None:
             text_parents = self.file_parents
         self.editor.texts.add_lines((self.file_id, text_revision), 
-            [(self.file_id, revid) for revid in text_parents], lines)
+                [(self.file_id, revid) for revid in text_parents], lines)
 
         if self.is_special is not None:
             self.is_symlink = (self.is_special and len(lines) > 0 and lines[0].startswith("link "))

=== modified file 'mapping.py'
--- a/mapping.py	2008-11-09 05:05:43 +0000
+++ b/mapping.py	2008-11-09 20:20:31 +0000
@@ -58,6 +58,15 @@
 SVN_REVPROP_BZR_TAGS = 'bzr:tags'
 
 
+def find_new_lines((oldvalue, newvalue)):
+    if oldvalue is None:
+        oldvalue = ""
+    if not newvalue.startswith(oldvalue):
+        raise ValueError("Existing contents were changed")
+    appended = newvalue[len(oldvalue):]
+    return appended.splitlines()
+
+
 def escape_svn_path(x):
     """Escape a Subversion path for use in a revision identifier.
 
@@ -425,6 +434,12 @@
         raise NotImplementedError(self.export_text_parents)
 
     def export_text_revisions(self, text_revisions, revprops, fileprops):
+        """Store a text revisions map.
+
+        :param text_parents: Text revision map
+        :param revprops: Revision properties
+        :param fileprops: File properties
+        """
         raise NotImplementedError(self.export_text_revisions)
 
     def import_text_revisions(self, revprops, fileprops):
@@ -512,18 +527,18 @@
         if metadata is not None:
             parse_revision_metadata(metadata[1], rev)
 
+    def import_text_parents(self, svn_revprops, fileprops):
+        metadata = fileprops.get(SVN_PROP_BZR_TEXT_PARENTS)
+        if metadata is None:
+            return {}
+        return parse_text_parents_property(metadata[1])
+
     def import_text_revisions(self, svn_revprops, fileprops):
         metadata = fileprops.get(SVN_PROP_BZR_TEXT_REVISIONS)
         if metadata is None:
             return {}
         return parse_text_revisions_property(metadata[1])
 
-    def import_text_parents(self, svn_revprops, fileprops):
-        metadata = fileprops.get(SVN_PROP_BZR_TEXT_PARENTS)
-        if metadata is None:
-            return {}
-        return parse_text_parents_property(metadata[1])
-
     def export_text_parents(self, text_parents, svn_revprops, fileprops):
         if text_parents != {}:
             fileprops[SVN_PROP_BZR_TEXT_PARENTS] = generate_text_parents_property(text_parents)
@@ -539,7 +554,15 @@
     def get_rhs_parents(self, branch_path, revprops, fileprops):
         bzr_merges = fileprops.get(SVN_PROP_BZR_ANCESTRY+self.name, None)
         if bzr_merges is not None:
-            return parse_merge_property(bzr_merges[1].splitlines()[-1])
+            try:
+                new_lines = find_new_lines(bzr_merges)
+            except ValueError, e:
+                mutter(str(e))
+                return ()
+            if len(new_lines) != 1:
+                mutter("unexpected number of lines in bzr merge property: %r" % new_lines)
+                return ()
+            return parse_merge_property(new_lines[0])
 
         return ()
 
@@ -590,12 +613,18 @@
         if text is None:
             return (None, None)
 
-        lines = text[1].splitlines()
-        if len(lines) == 0:
-            return (None, None)
-
-        try:
-            return parse_revid_property(lines[-1])
+        try:
+            new_lines = find_new_lines(text)
+        except ValueError, e:
+            mutter(str(e))
+            return (None, None)
+
+        if len(new_lines) != 1:
+            mutter("unexpected number of lines: %r" % new_lines)
+            return (None, None)
+
+        try:
+            return parse_revid_property(new_lines[0])
         except errors.InvalidPropertyValue, e:
             mutter(str(e))
             return (None, None)

=== modified file 'repository.py'
--- a/repository.py	2008-11-08 14:31:15 +0000
+++ b/repository.py	2008-11-09 20:20:31 +0000
@@ -356,7 +356,7 @@
 
     def set_make_working_trees(self, new_value):
         """See Repository.set_make_working_trees()."""
-        pass # FIXME: ignored, nowhere to store it... 
+        pass # ignored, nowhere to store it... 
 
     def make_working_trees(self):
         """See Repository.make_working_trees().

=== modified file 'revids.py'
--- a/revids.py	2008-11-09 05:05:43 +0000
+++ b/revids.py	2008-11-09 20:20:31 +0000
@@ -22,7 +22,7 @@
 from bzrlib.plugins.svn.cache import CacheTable
 from subvertpy import SubversionException, ERR_FS_NO_SUCH_REVISION
 from bzrlib.plugins.svn.errors import InvalidPropertyValue, InvalidBzrSvnRevision
-from bzrlib.plugins.svn.mapping import (BzrSvnMapping, 
+from bzrlib.plugins.svn.mapping import (BzrSvnMapping, find_new_lines,
                      SVN_PROP_BZR_REVISION_ID, parse_revid_property,
                      find_mapping, mapping_registry, is_bzr_revision_revprops)
 
@@ -110,8 +110,16 @@
                 if not propname.startswith(SVN_PROP_BZR_REVISION_ID):
                     continue
                 try:
+                    new_lines = find_new_lines((oldpropvalue, propvalue))
+                    if len(new_lines) != 1:
+                        continue
+                except ValueError:
+                    # Don't warn about encountering an invalid property, 
+                    # that will already have happened earlier
+                    continue
+                try:
                     (entry_revno, entry_revid) = parse_revid_property(
-                        propvalue.splitlines()[-1])
+                        new_lines[0])
                 except InvalidPropertyValue:
                     # Don't warn about encountering an invalid property, 
                     # that will already have happened earlier




More information about the bazaar-commits mailing list