Rev 1744: Cope with new changed file properties return format. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sun Nov 9 05:06:09 GMT 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1744
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
=== modified file 'fetch.py'
--- a/fetch.py	2008-11-08 20:54:43 +0000
+++ b/fetch.py	2008-11-09 05:06:06 +0000
@@ -124,7 +124,7 @@
             # Replay lazy_dict, since it may be more expensive
             if type(self.editor.revmeta.fileprops) != dict:
                 self.editor.revmeta.fileprops = {}
-            self.editor.revmeta.fileprops[name] = value
+            self.editor.revmeta.fileprops[name] = (None, value)
 
         if name in (properties.PROP_ENTRY_COMMITTED_DATE,
                     properties.PROP_ENTRY_COMMITTED_REV,

=== modified file 'mapping.py'
--- a/mapping.py	2008-11-08 20:54:43 +0000
+++ b/mapping.py	2008-11-09 05:06:06 +0000
@@ -509,22 +509,22 @@
     def import_revision(self, svn_revprops, fileprops, uuid, branch, revnum, rev):
         parse_svn_revprops(svn_revprops, rev)
         if SVN_PROP_BZR_LOG in fileprops:
-            rev.message = fileprops[SVN_PROP_BZR_LOG]
+            rev.message = fileprops[SVN_PROP_BZR_LOG][1]
         metadata = fileprops.get(SVN_PROP_BZR_REVISION_INFO)
         if metadata is not None:
-            parse_revision_metadata(metadata, rev)
+            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)
+        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)
+        return parse_text_revisions_property(metadata[1])
 
     def export_text_parents(self, can_use_custom_revprops, text_parents, svn_revprops, fileprops):
         if text_parents != {}:
@@ -541,13 +541,13 @@
     def get_rhs_parents(self, branch_path, revprops, fileprops):
         bzr_merges = fileprops.get(SVN_PROP_BZR_ANCESTRY+str(self.scheme), None)
         if bzr_merges is not None:
-            return parse_merge_property(bzr_merges.splitlines()[-1])
+            return parse_merge_property(bzr_merges[1].splitlines()[-1])
 
         return ()
 
     def get_rhs_ancestors(self, branch_path, revprops, fileprops):
         ancestry = []
-        for l in fileprops.get(SVN_PROP_BZR_ANCESTRY+str(self.scheme), "").splitlines():
+        for l in fileprops.get(SVN_PROP_BZR_ANCESTRY+str(self.scheme), (None, ""))[1].splitlines():
             ancestry.extend(l.split("\n"))
         return ancestry
 
@@ -555,7 +555,7 @@
         fileids = fileprops.get(SVN_PROP_BZR_FILEIDS, None)
         if fileids is None:
             return {}
-        return parse_fileid_property(fileids)
+        return parse_fileid_property(fileids[1])
 
     def _record_merges(self, merges, fileprops):
         """Store the extra merges (non-LHS parents) in a file property.
@@ -598,7 +598,7 @@
         if text is None:
             return (None, None)
 
-        lines = text.splitlines()
+        lines = text[1].splitlines()
         if len(lines) == 0:
             return (None, None)
 

=== modified file 'repository.py'
--- a/repository.py	2008-11-09 04:33:22 +0000
+++ b/repository.py	2008-11-09 05:06:06 +0000
@@ -92,7 +92,8 @@
         else:
             previous = logwalker.lazy_dict({}, self.repository.branchprop_list.get_properties, prev_path.encode("utf-8"), prev_revnum)
 
-        return tuple(self.repository._svk_merged_revisions(self.branch_path, self.revnum, mapping, self.fileprops, previous))
+        return tuple(self.repository._svk_merged_revisions(self.branch_path, self.revnum, mapping, 
+            self.fileprops))
 
     def get_parent_ids(self, mapping):
         parents_cache = getattr(self.repository._real_parents_provider, "_cache", None)
@@ -555,15 +556,14 @@
         return parent_map
 
     def _svk_merged_revisions(self, branch, revnum, mapping, 
-                              current_fileprops, previous_fileprops):
+                              changed_fileprops):
         """Find out what SVK features were merged in a revision.
 
         """
-        current = current_fileprops.get(SVN_PROP_SVK_MERGE, "")
-        if current == "":
+        previous, current = changed_fileprops.get(SVN_PROP_SVK_MERGE, ("", ""))
+        if current in (None, ""):
             return
-        previous = previous_fileprops.get(SVN_PROP_SVK_MERGE, "")
-        for feature in svk_features_merged_since(current, previous):
+        for feature in svk_features_merged_since(current, previous or ""):
             # We assume svk:merge is only relevant on non-bzr-svn revisions. 
             # If this is a bzr-svn revision, the bzr-svn properties 
             # would be parsed instead.

=== modified file 'revids.py'
--- a/revids.py	2008-08-24 22:15:46 +0000
+++ b/revids.py	2008-11-09 05:06:06 +0000
@@ -108,7 +108,7 @@
         # Find the branch property between min_revnum and max_revnum that 
         # added revid
         for revmeta in self.repos.iter_reverse_branch_changes(branch_path, max_revnum, min_revnum):
-            for propname, propvalue in revmeta.fileprops.items():
+            for propname, (oldpropvalue, propvalue) in revmeta.fileprops.items():
                 if not propname.startswith(SVN_PROP_BZR_REVISION_ID):
                     continue
                 try:

=== modified file 'tests/test_push.py'
--- a/tests/test_push.py	2008-11-08 20:54:43 +0000
+++ b/tests/test_push.py	2008-11-09 05:06:06 +0000
@@ -617,7 +617,7 @@
         wt1.branch.push(Branch.open(repos_url+"/trunk"))
         r = Repository.open(repos_url)
         props = r.branchprop_list.get_changed_properties("trunk", 3)
-        self.assertEquals(props['bzr:text-revisions'], 'bar2.txt\tside1\n')
+        self.assertEquals(props['bzr:text-revisions'][1], 'bar2.txt\tside1\n')
 
         os.mkdir("cpy")
         cpy = BzrDir.create("cpy", format.get_rich_root_format())




More information about the bazaar-commits mailing list