Rev 311: Eliminate unused code. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Tue Dec 26 22:26:00 GMT 2006


------------------------------------------------------------
revno: 311
revision-id: jelmer at samba.org-20061226222529-x4ch5ttzqw6apc84
parent: jelmer at samba.org-20061226220429-85up7e6w2qw90pwb
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2006-12-26 23:25:29 +0100
message:
  Eliminate unused code.
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'branch.py'
--- a/branch.py	2006-12-26 15:28:13 +0000
+++ b/branch.py	2006-12-26 22:25:29 +0000
@@ -112,7 +112,7 @@
        
     def _generate_revision_history(self, last_revnum):
         self._revision_history = []
-        for (branch, rev) in self.repository.follow_branch(
+        for (branch, _, rev) in self.repository.follow_branch_history(
                 self.branch_path, last_revnum):
             self._revision_history.append(
                     self.repository.generate_revision_id(rev, branch))

=== modified file 'errors.py'
--- a/errors.py	2006-12-26 17:35:31 +0000
+++ b/errors.py	2006-12-26 22:25:29 +0000
@@ -16,17 +16,6 @@
 
 from bzrlib.errors import BzrError
 
-class DirUpgrade(BzrError):
-    _fmt = """Dir %(from_path)s:%(from_revnum)d is upgraded to branch %(to_path)s in %(to_revnum)d. Not supported yet. """
-
-    def __init__(self, from_tuple, to_tuple):
-        BzrError.__init__(self)
-        self.to_path = to_tuple[0]
-        self.to_revnum = to_tuple[1]
-        self.from_path = from_tuple[0]
-        self.from_revnum = from_tuple[1]
-
-
 class NotSvnBranchPath(BzrError):
     _fmt = """{%(branch_path)s}:%(revnum)s is not a valid Svn branch path"""
 

=== modified file 'repository.py'
--- a/repository.py	2006-12-26 22:04:29 +0000
+++ b/repository.py	2006-12-26 22:25:29 +0000
@@ -313,7 +313,7 @@
                                     SVN_PROP_BZR_MERGE, "").splitlines():
             ancestry.extend(l.split("\n"))
 
-        for (branch, rev) in self.follow_branch(path, revnum - 1):
+        for (branch, _, rev) in self.follow_branch_history(path, revnum - 1):
             ancestry.append(self.generate_revision_id(rev, branch))
 
         ancestry.append(None)
@@ -358,7 +358,7 @@
 
         parent_path = None
         parent_ids = []
-        for (branch, rev) in self.follow_branch(path, revnum):
+        for (branch, _, rev) in self.follow_branch_history(path, revnum):
             if rev < revnum:
                 parent_revnum = rev
                 parent_path = branch
@@ -422,9 +422,7 @@
 
         rev.timestamp = 1.0 * svn.core.secs_from_timestr(date, None)
         rev.timezone = None
-
         rev.properties = bzr_props
-
         rev.inventory_sha1 = property(lambda: self.get_inventory_sha1(revision_id))
 
         return rev
@@ -495,10 +493,6 @@
     def get_revision_sha1(self, revision_id):
         return osutils.sha_string(self.get_revision_xml(revision_id))
 
-    def follow_branch(self, branch_path, revnum):
-        for (bp, _, rev) in self.follow_branch_history(branch_path, revnum):
-            yield (bp, rev)
-
     def follow_history(self, revnum):
         while revnum > 0:
             paths = self._log.get_revision_paths(revnum)
@@ -569,7 +563,7 @@
         self._previous = revision_id
         self._ancestry = {}
         
-        for (branch, rev) in self.follow_branch(path, revnum - 1):
+        for (branch, _, rev) in self.follow_branch_history(path, revnum - 1):
             revid = self.generate_revision_id(rev, branch)
             self._ancestry[self._previous] = [revid]
             self._previous = revid

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2006-12-26 21:08:52 +0000
+++ b/tests/test_repos.py	2006-12-26 22:25:29 +0000
@@ -59,13 +59,13 @@
 
         repos = Repository.open(repos_url)
 
-        self.assertEqual(1, len(list(repos.follow_branch("", 1))))
+        self.assertEqual(1, len(list(repos.follow_branch_history("", 1))))
 
     def test_get_branch_invalid_revision(self):
         repos_url = self.make_client("a", "dc")
         repos = Repository.open(repos_url)
         self.assertRaises(NoSuchRevision, list, 
-                          repos.follow_branch("/", 20))
+                          repos.follow_branch_history("/", 20))
 
     def test_history_all(self):
         repos_url = self.make_client("a", "dc")
@@ -92,7 +92,7 @@
         repos = Repository.open(repos_url)
         repos.set_branching_scheme(TrunkBranchingScheme())
 
-        self.assertEqual(1, len(list(repos.follow_branch("branches/brancha",
+        self.assertEqual(1, len(list(repos.follow_branch_history("branches/brancha",
             1))))
 
     def test_find_branches_no(self):




More information about the bazaar-commits mailing list