Rev 2062: Cope with another corner case. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Mon Nov 24 17:16:38 GMT 2008


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

------------------------------------------------------------
revno: 2062
revision-id: jelmer at samba.org-20081124171635-qvr0bpu2jw6vioya
parent: jelmer at samba.org-20081124031012-tlz43srmrvfrkqy8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-11-24 18:16:35 +0100
message:
  Cope with another corner case.
modified:
  revmeta.py                     revmeta.py-20080901215045-n8a6arqybs9ez5hl-1
=== modified file 'revmeta.py'
--- a/revmeta.py	2008-11-24 03:10:12 +0000
+++ b/revmeta.py	2008-11-24 17:16:35 +0000
@@ -30,17 +30,18 @@
         )
 from bzrlib.plugins.svn.foreign import ForeignRevision
 from bzrlib.plugins.svn.mapping import (
+        estimate_bzr_ancestors, 
+        find_mapping,
+        get_roundtrip_ancestor_revids,
         is_bzr_revision_fileprops, 
         is_bzr_revision_revprops, 
-        estimate_bzr_ancestors, 
         SVN_REVPROP_BZR_SIGNATURE, 
-        get_roundtrip_ancestor_revids,
         )
 from bzrlib.plugins.svn.svk import (
+        estimate_svk_ancestors,
+        parse_svk_feature, 
+        svk_features_merged_since, 
         SVN_PROP_SVK_MERGE, 
-        svk_features_merged_since, 
-        parse_svk_feature, 
-        estimate_svk_ancestors,
         )
 
 import bisect
@@ -225,8 +226,13 @@
         taking into account that it shouldn't be newer than 'max_mapping'.
 
         """
-        # TODO
-        return newest_allowed
+        if not self.is_bzr_revision():
+            return newest_allowed
+        ret = find_mapping(self.get_revprops(), self.get_changed_fileprops())
+        # FIXME: Make sure ret is older than newest_allowed
+        if ret is None:
+            return newest_allowed
+        return ret
 
     def get_lhs_parent(self, mapping):
         """Find the revid of the left hand side parent of this revision."""
@@ -750,9 +756,10 @@
                     unusual.remove(new_name)
                 if old_name is None: 
                     # didn't exist previously
-                    del metabranches[new_name]
+                    if new_name in metabranches:
+                        del metabranches[new_name]
                 else:
-                    data = metabranches[new_name]
+                    data = get_metabranch(new_name)
                     del metabranches[new_name]
                     if mapping_check_path(old_name):
                         metabranches_history.setdefault(old_rev, {})[old_name] = data




More information about the bazaar-commits mailing list