Rev 462: Some more docs, use different cache dir (to avoid conflicts with older installs. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Sun May 27 14:35:32 BST 2007


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

------------------------------------------------------------
revno: 462
revision-id: jelmer at samba.org-20070527133530-oigy2iqo1qcgars0
parent: jelmer at samba.org-20070522015615-j2hh7yy30ceqo8b5
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sun 2007-05-27 15:35:30 +0200
message:
  Some more docs, use different cache dir (to avoid conflicts with older installs.
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'branch.py'
--- a/branch.py	2007-05-18 12:22:57 +0000
+++ b/branch.py	2007-05-27 13:35:30 +0000
@@ -113,15 +113,19 @@
         return WorkingTree.open(to_location)
 
     def create_checkout(self, to_location, revision_id=None, lightweight=False):
+        """See Branch.create_checkout()."""
         if lightweight:
             return self._create_lightweight_checkout(to_location, revision_id)
         else:
             return self._create_heavyweight_checkout(to_location, revision_id)
 
     def generate_revision_id(self, revnum):
+        """Generate a new revision id for a revision on this branch."""
+        # FIXME: What if this branch had a different name in the past?
         return self.repository.generate_revision_id(revnum, self.branch_path)
        
     def _generate_revision_history(self, last_revnum):
+        """Generate the revision history up until a specified revision."""
         self._revision_history = []
         for (branch, rev) in self.repository.follow_branch(
                 self.branch_path, last_revnum):

=== modified file 'repository.py'
--- a/repository.py	2007-05-21 12:41:26 +0000
+++ b/repository.py	2007-05-27 13:35:30 +0000
@@ -162,7 +162,7 @@
         assert self.base
         assert self.uuid
 
-        cache_file = os.path.join(self.create_cache_dir(), 'cache-v1')
+        cache_file = os.path.join(self.create_cache_dir(), 'cache-v%d' % MAPPING_VERSIO)
         if not cachedbs.has_key(cache_file):
             cachedbs[cache_file] = sqlite3.connect(cache_file)
         self.cachedb = cachedbs[cache_file]
@@ -417,8 +417,10 @@
         if revid is not None:
             return revid
 
+        # Lookup the revision from the bzr:revision-id-vX property
         revid = self.branchprop_list.get_property_diff(path, revnum, 
                 SVN_PROP_BZR_REVISION_ID).strip("\n")
+        # Or generate it
         if revid == "":
             revid = generate_svn_revision_id(self.uuid, revnum, path)
 
@@ -475,10 +477,10 @@
         i = min_revnum
         for (bp, rev) in self.follow_branch(branch_path, max_revnum):
             if self.branchprop_list.get_property_diff(bp, rev, SVN_PROP_BZR_REVISION_ID).strip("\n") == revid:
-                self.revmap.insert_revid(revid, bp, rev, rev, "undefined")
+                self.revmap.insert_revid(revid, bp, rev, rev, scheme)
                 return (bp, rev)
 
-        raise AssertionError("Revision id was added incorrectly")
+        raise AssertionError("Revision id %s was added incorrectly" % revid)
 
     def get_inventory_xml(self, revision_id):
         return bzrlib.xml5.serializer_v5.write_inventory_to_string(




More information about the bazaar-commits mailing list