Rev 1499: eliminate uuid argument in file id map manipulation functions. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Wed Jul 23 20:35:25 BST 2008


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

------------------------------------------------------------
revno: 1499
revision-id: jelmer at samba.org-20080723193524-9v6t8s0f9so0mxhe
parent: jelmer at samba.org-20080723192955-p8qqp896ijvql4sf
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-07-23 21:35:24 +0200
message:
  eliminate uuid argument in file id map manipulation functions.
modified:
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
  fileids.py                     fileids.py-20060714013623-u5iiyqqnko11grcf-1
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'fetch.py'
--- a/fetch.py	2008-07-23 19:29:55 +0000
+++ b/fetch.py	2008-07-23 19:35:24 +0000
@@ -113,7 +113,7 @@
         if self._id_map is not None:
             return self._id_map
 
-        self._id_map = self.source.transform_fileid_map(self.source.uuid, self.revmeta, self.mapping)
+        self._id_map = self.source.transform_fileid_map(self.revmeta, self.mapping)
 
         return self._id_map
 

=== modified file 'fileids.py'
--- a/fileids.py	2008-07-23 19:29:55 +0000
+++ b/fileids.py	2008-07-23 19:35:24 +0000
@@ -109,10 +109,9 @@
         self.apply_changes_fn = apply_changes_fn
         self.repos = repos
 
-    def apply_changes(self, uuid, revmeta, mapping, find_children=None):
+    def apply_changes(self, revmeta, mapping, find_children=None):
         """Change file id map to incorporate specified changes.
 
-        :param uuid: UUID of repository changes happen in
         :param revmeta: RevisionMetadata object for revision with changes
         :param renames: List of renames (known file ids for particular paths)
         :param mapping: Mapping
@@ -130,7 +129,7 @@
             get_children = None
 
         def new_file_id(x):
-            return mapping.generate_file_id(uuid, revmeta.revnum, revmeta.branch_path, x)
+            return mapping.generate_file_id(revmeta.uuid, revmeta.revnum, revmeta.branch_path, x)
          
         idmap = self.apply_changes_fn(new_file_id, changes, get_children)
         idmap.update(renames)
@@ -167,15 +166,14 @@
                     expensive = True
                     return self.repos._log.find_children(path, revnum)
 
-                (idmap, changes) = self.apply_changes(self.repos.uuid, 
-                        revmeta, 
+                (idmap, changes) = self.apply_changes(revmeta, 
                         mapping, log_find_children)
-                pb.update('generating file id map', i, len(todo))
-
-                parent_revs = next_parent_revs
-
                 self.update_map(map, revid, idmap, changes)
                        
+                pb.update('generating file id map', i, len(todo))
+
+                parent_revs = next_parent_revs
+
                 next_parent_revs = [revid]
                 i += 1
         finally:
@@ -285,13 +283,13 @@
                     expensive = True
                     return self.repos._log.find_children(path, revnum)
 
-                (idmap, changes) = self.actual.apply_changes(self.repos.uuid, 
+                (idmap, changes) = self.actual.apply_changes(
                         revmeta, mapping, log_find_children)
-                pb.update('generating file id map', i, len(todo))
-
-                parent_revs = next_parent_revs
 
                 self.actual.update_map(map, revid, idmap, changes)
+                pb.update('generating file id map', i, len(todo))
+
+                parent_revs = next_parent_revs
                        
                 saved = False
                 if i % 500 == 0 or expensive:

=== modified file 'mapping.py'
--- a/mapping.py	2008-07-23 01:53:35 +0000
+++ b/mapping.py	2008-07-23 19:35:24 +0000
@@ -530,6 +530,7 @@
         else:
             fileprops[SVN_PROP_BZR_FILEIDS] = ""
 
+
 class BzrSvnMappingRevProps(object):
     @classmethod
     def supports_custom_revprops(cls):

=== modified file 'repository.py'
--- a/repository.py	2008-07-23 19:29:55 +0000
+++ b/repository.py	2008-07-23 19:35:24 +0000
@@ -67,6 +67,7 @@
         self.revnum = revnum
         self.revprops = revprops
         self.fileprops = fileprops
+        self.uuid = repository.uuid
 
     def __repr__(self):
         return "<RevisionMetadata for revision %d in repository %s>" % (self.revnum, self.repository.uuid)
@@ -351,8 +352,8 @@
     def get_fileid_map(self, revnum, path, mapping):
         return self.fileid_map.get_map(self.uuid, revnum, path, mapping)
 
-    def transform_fileid_map(self, uuid, revmeta, mapping):
-        return self.fileid_map.apply_changes(uuid, revmeta, mapping)[0]
+    def transform_fileid_map(self, revmeta, mapping):
+        return self.fileid_map.apply_changes(revmeta, mapping)[0]
 
     def iter_all_changes(self, layout=None, pb=None):
         if layout is None:




More information about the bazaar-commits mailing list