Rev 2002: use foreign_revid as tuple rather than separate variables. in file:///data/jelmer/bzr-svn/0.5/

Jelmer Vernooij jelmer at samba.org
Mon Nov 17 16:01:48 GMT 2008


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

------------------------------------------------------------
revno: 2002
revision-id: jelmer at samba.org-20081117160146-jih1cr33zwsgrv0x
parent: jelmer at samba.org-20081117155723-5r0slbp4hd979fb0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-11-17 17:01:46 +0100
message:
  use foreign_revid as tuple rather than separate variables.
modified:
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  revmeta.py                     revmeta.py-20080901215045-n8a6arqybs9ez5hl-1
  svk.py                         svk.py-20080201171509-m2eg9m6jrmlbwxg5-1
=== modified file 'commit.py'
--- a/commit.py	2008-11-12 10:57:24 +0000
+++ b/commit.py	2008-11-17 16:01:46 +0000
@@ -67,10 +67,10 @@
     :return: Matching SVK feature identifier.
     """
     assert isinstance(revid, str)
-    (uuid, branch, revnum), _ = mapping.mapping_registry.parse_revision_id(revid)
+    foreign_revid, _ = mapping.mapping_registry.parse_revision_id(revid)
     # TODO: What about renamed revisions? Should use 
     # repository.lookup_revision_id here.
-    return generate_svk_feature(uuid, branch, revnum)
+    return generate_svk_feature(foreign_revid)
 
 
 def _check_dirs_exist(transport, bp_parts, base_rev):

=== modified file 'revmeta.py'
--- a/revmeta.py	2008-11-12 14:34:17 +0000
+++ b/revmeta.py	2008-11-17 16:01:46 +0000
@@ -103,6 +103,9 @@
             return self.get_changed_fileprops() != {}
         return self.branch_path in self.get_paths()
 
+    def get_foreign_revid(self):
+        return (self.uuid, self.branch_path, self.revnum)
+
     def get_paths(self):
         """Fetch the changed paths dictionary for this revision.
         """
@@ -121,7 +124,7 @@
 
         # Or generate it
         if revid is None:
-            return mapping.revision_id_foreign_to_bzr((self.uuid, self.branch_path, self.revnum))
+            return mapping.revision_id_foreign_to_bzr(self.get_foreign_revid())
 
         return revid
 
@@ -343,7 +346,7 @@
 
         if parent_ids == (NULL_REVISION,):
             parent_ids = ()
-        rev = ForeignRevision(foreign_revid=(self.uuid, self.branch_path, self.revnum),
+        rev = ForeignRevision(foreign_revid=self.get_foreign_revid(),
                               mapping=mapping, revision_id=self.get_revision_id(mapping), 
                        parent_ids=parent_ids,
                        inventory_sha1="")

=== modified file 'svk.py'
--- a/svk.py	2008-09-02 10:11:44 +0000
+++ b/svk.py	2008-11-17 16:01:46 +0000
@@ -45,7 +45,7 @@
     return (uuid, branch.strip("/"), int(revnum))
 
 
-def generate_svk_feature(uuid, branch, revnum):
+def generate_svk_feature((uuid, branch, revnum)):
     """Create a SVK feature identifier.
 
     :param uuid: Subversion repository UUID




More information about the bazaar-commits mailing list