Rev 439: More formatting fixes. in sftp://people.samba.org/~/bzr/bzr-svn/0.3/
Jelmer Vernooij
jelmer at samba.org
Sun Mar 25 15:42:50 BST 2007
At sftp://people.samba.org/~/bzr/bzr-svn/0.3/
------------------------------------------------------------
revno: 439
revision-id: jelmer at samba.org-20070325144144-axorlmksch0g02ps
parent: jelmer at samba.org-20070324154013-9slv88wjxilfigto
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.3
timestamp: Sun 2007-03-25 16:41:44 +0200
message:
More formatting fixes.
modified:
TODO todo-20060729211917-2kpobww0zyvvo0j2-1
__init__.py __init__.py-20051008155114-eae558e6cf149e1d
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
fileids.py fileids.py-20060714013623-u5iiyqqnko11grcf-1
format.py format.py-20060406233823-b6fa009fe35dfde7
repository.py repository.py-20060306123302-1f8c5069b3fe0265
scheme.py scheme.py-20060516195850-95181aae6b272f9e
tests/__init__.py __init__.py-20060508151940-e9f4d914801a2535
tests/test_branch.py test_branch.py-20060508162215-74ffeb5d608f8e20
tests/test_branchprops.py test_branchprops.py-20061223210444-04xf5224zcg69m3w-1
tests/test_checkout.py test_checkout.py-20070101154110-eevkc29qj0q7udz5-1
tests/test_commit.py test_commit.py-20060624213521-l5kcufywkh9mnilk-1
tests/test_convert.py test_convert.py-20060705203611-b1l0bapeku6foco0-1
tests/test_fileids.py test_fileids.py-20060622131341-19gyrlgqy8yl2od5-1
tests/test_logwalker.py test_logwalker.py-20060622141944-pkocc3rj8g62ukbi-1
tests/test_radir.py test_radir.py-20061231173434-31utf9o4byu7wktm-1
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
tests/test_transport.py test_transport.py-20060621232111-xh7xvoblzsrgj79t-1
tests/test_tree.py test_tree.py-20070103204350-pr8nupes7e5sd2wr-1
tests/test_upgrade.py test_upgrade.py-20070106170128-64zt3eqggg4tng1c-1
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
upgrade.py upgrade.py-20070106192108-0rakplee2lzah4gs-1
=== modified file 'TODO'
--- a/TODO 2007-03-24 15:40:13 +0000
+++ b/TODO 2007-03-25 14:41:44 +0000
@@ -17,3 +17,4 @@
- report changes to delta editor in Branch.pull()
- add tests for objects returned by WorkingTree.pull(), Branch.pull()
- blackbox tests
+- test Branch.get_parent()
=== modified file '__init__.py'
--- a/__init__.py 2007-03-24 15:40:13 +0000
+++ b/__init__.py 2007-03-25 14:41:44 +0000
@@ -53,9 +53,8 @@
"""Check that Subversion is compatible.
"""
- try:
- from svn.delta import svn_delta_invoke_txdelta_window_handler
- except:
+ import svn.delta
+ if not hasattr(svn.delta, 'svn_delta_invoke_txdelta_window_handler'):
warning('Installed Subversion version does not have updated Python '
'bindings. See the bzr-svn README for details.')
raise bzrlib.errors.BzrError("incompatible python subversion bindings")
=== modified file 'branch.py'
--- a/branch.py 2007-03-24 15:40:13 +0000
+++ b/branch.py 2007-03-25 14:41:44 +0000
@@ -87,7 +87,7 @@
rev.kind = svn.core.svn_opt_revision_head
else:
assert revision_id in self.revision_history()
- (bp, revnum) = self.repository.parse_revision_id(revision_id)
+ (_, revnum) = self.repository.parse_revision_id(revision_id)
rev.kind = svn.core.svn_opt_revision_number
rev.value.number = revnum
mutter('hist: %r' % self.revision_history())
@@ -225,7 +225,7 @@
pass
def get_parent(self):
- return self.bzrdir.root_transport.base
+ return self.base
def set_parent(self, url):
pass # FIXME: Use svn.client.switch()
=== modified file 'convert.py'
--- a/convert.py 2007-03-24 15:40:13 +0000
+++ b/convert.py 2007-03-25 14:41:44 +0000
@@ -116,7 +116,7 @@
try:
i = 0
- for (branch, revnum, exists) in existing_branches:
+ for (branch, revnum, _) in existing_branches:
if source_repos.transport.check_path(branch, revnum) == svn.core.svn_node_file:
continue
pb.update("%s:%d" % (branch, revnum), i, len(existing_branches))
=== modified file 'fetch.py'
--- a/fetch.py 2007-03-24 15:40:13 +0000
+++ b/fetch.py 2007-03-25 14:41:44 +0000
@@ -337,6 +337,7 @@
def copy_content(self, revision_id=None, basis=None, pb=None):
"""See InterRepository.copy_content."""
+ # FIXME: Use basis
# Dictionary with paths as keys, revnums as values
# Loop over all the revnums until revision_id
=== modified file 'fileids.py'
--- a/fileids.py 2007-03-24 15:40:13 +0000
+++ b/fileids.py 2007-03-25 14:41:44 +0000
@@ -22,7 +22,6 @@
import os
import sha
-import logwalker
from repository import (escape_svn_path, generate_svn_revision_id,
parse_svn_revision_id)
@@ -107,7 +106,7 @@
def load(self, revid):
map = {}
for filename, create_revid, id in self.cachedb.execute("select filename, create_revid, id from filemap where revid='%s'"%revid):
- map[filename] = (id.encode("utf-8"),create_revid.encode("utf-8"))
+ map[filename] = (id.encode("utf-8"), create_revid.encode("utf-8"))
return map
=== modified file 'format.py'
--- a/format.py 2007-03-24 15:40:13 +0000
+++ b/format.py 2007-03-25 14:41:44 +0000
@@ -175,7 +175,7 @@
"non-local transports")
local_path = transport._local_base.rstrip("/")
- repos = svn.repos.create(local_path, '', '', None, None)
+ svn.repos.create(local_path, '', '', None, None)
return self.open(SvnRaTransport(transport.base), _found=True)
def is_supported(self):
=== modified file 'repository.py'
--- a/repository.py 2007-03-24 15:40:13 +0000
+++ b/repository.py 2007-03-25 14:41:44 +0000
@@ -17,10 +17,8 @@
import bzrlib
from bzrlib.branch import BranchCheckResult
from bzrlib.config import config_dir, ensure_config_dir_exists
-from bzrlib.errors import (BzrError, InvalidRevisionId, NoSuchFile,
- NoSuchRevision, NotBranchError,
- UninitializableFormat)
-from bzrlib.graph import Graph
+from bzrlib.errors import (InvalidRevisionId, NoSuchRevision,
+ NotBranchError, UninitializableFormat)
from bzrlib.inventory import Inventory
from bzrlib.lockable_files import LockableFiles, TransportLock
import bzrlib.osutils as osutils
@@ -34,13 +32,11 @@
import svn.core
import os
-from cStringIO import StringIO
try:
import sqlite3
except ImportError:
from pysqlite2 import dbapi2 as sqlite3
-import branch
from branchprops import BranchPropertyList
import errors
import logwalker
@@ -413,12 +409,7 @@
raise NotImplementedError(self.fileids_altered_by_revision_ids)
def fileid_involved_by_set(self, changes):
- ids = []
-
- for revid in changes:
- pass #FIXME
-
- return ids
+ raise NotImplementedError(self.fileid_involved_by_set)
def generate_revision_id(self, revnum, path):
"""Generate a unambiguous revision id.
@@ -472,7 +463,7 @@
yielded_paths.append(bp)
except NotBranchError:
pass
- revnum-=1
+ revnum -= 1
def follow_branch(self, branch_path, revnum):
assert branch_path is not None
@@ -484,7 +475,7 @@
while revnum > 0:
paths = self._log.get_revision_paths(revnum, branch_path)
if paths == {}:
- revnum-=1
+ revnum -= 1
continue
yield (branch_path, revnum)
# FIXME: what if one of the parents of branch_path was moved?
@@ -500,7 +491,7 @@
revnum = paths[branch_path][2]
branch_path = paths[branch_path][1]
continue
- revnum-=1
+ revnum -= 1
def follow_branch_history(self, branch_path, revnum):
assert branch_path is not None
=== modified file 'scheme.py'
--- a/scheme.py 2007-01-14 04:11:21 +0000
+++ b/scheme.py 2007-03-25 14:41:44 +0000
@@ -44,7 +44,7 @@
:return: New BranchingScheme instance.
"""
parts = relpath.strip("/").split("/")
- for i in range(0,len(parts)):
+ for i in range(0, len(parts)):
if parts[i] in ("trunk", "branches", "tags"):
return TrunkBranchingScheme(level=i)
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2007-03-13 09:40:12 +0000
+++ b/tests/__init__.py 2007-03-25 14:41:44 +0000
@@ -14,7 +14,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-import svn.repos
import os
import bzrlib
from bzrlib import osutils
@@ -47,7 +46,7 @@
abspath = os.path.join(self.test_dir, relpath)
repos_url = "file://%s" % abspath
- repos = svn.repos.create(abspath, '', '', None, None)
+ svn.repos.create(abspath, '', '', None, None)
revprop_hook = os.path.join(abspath, "hooks", "pre-revprop-change")
@@ -220,7 +219,7 @@
def test_suite():
- from unittest import TestSuite, TestLoader
+ from unittest import TestSuite
from bzrlib.tests import TestUtil
=== modified file 'tests/test_branch.py'
--- a/tests/test_branch.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_branch.py 2007-03-25 14:41:44 +0000
@@ -15,7 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from bzrlib.branch import Branch
-from bzrlib.bzrdir import BzrDir, BzrDirTestProviderAdapter, BzrDirFormat
+from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NoSuchFile
from bzrlib.inventory import ROOT_ID
from bzrlib.repository import Repository
@@ -24,11 +24,8 @@
import os
from unittest import TestCase
-import svn.core, svn.client
-
from branch import FakeControlFiles, SvnBranchFormat
from convert import load_dumpfile
-import format
from repository import MAPPING_VERSION, generate_svn_revision_id
from tests import TestCaseWithSubversionRepository
@@ -474,13 +471,13 @@
weave.versions())
def test_check(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
branch = Branch.open('d')
result = branch.check()
self.assertEqual(branch, result.branch)
def test_generate_revision_id(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
branch = Branch.open('d')
self.assertEqual("svn-v%d:1@%s-" % (MAPPING_VERSION, branch.repository.uuid), branch.generate_revision_id(1))
@@ -539,7 +536,7 @@
self.assertFalse(os.path.exists("e/.bzr"))
def test_fetch_branch(self):
- repos_url = self.make_client('d', 'sc')
+ self.make_client('d', 'sc')
self.build_tree({'sc/foo/bla': "data"})
self.client_add("sc/foo")
@@ -558,7 +555,7 @@
def test_ghost_workingtree(self):
# Looks like bazaar has trouble creating a working tree of a
# revision that has ghost parents
- repos_url = self.make_client('d', 'sc')
+ self.make_client('d', 'sc')
self.build_tree({'sc/foo/bla': "data"})
self.client_add("sc/foo")
=== modified file 'tests/test_branchprops.py'
--- a/tests/test_branchprops.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_branchprops.py 2007-03-25 14:41:44 +0000
@@ -19,7 +19,6 @@
from tests import TestCaseWithSubversionRepository
from branchprops import BranchPropertyList
from logwalker import LogWalker
-from scheme import NoBranchingScheme
from transport import SvnRaTransport
try:
=== modified file 'tests/test_checkout.py'
--- a/tests/test_checkout.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_checkout.py 2007-03-25 14:41:44 +0000
@@ -19,8 +19,6 @@
from bzrlib.tests import TestCase
from checkout import SvnWorkingTreeFormat
-from format import SvnRemoteAccess
-from repository import SvnRepository
from tests import TestCaseWithSubversionRepository
class TestWorkingTreeFormat(TestCase):
@@ -41,17 +39,17 @@
class TestCheckout(TestCaseWithSubversionRepository):
def test_not_for_writing(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
x = BzrDir.create_branch_convenience("dc/foo")
self.assertFalse(hasattr(x.repository, "uuid"))
def test_open_repository(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
x = BzrDir.open("dc")
self.assertRaises(NoRepositoryPresent, x.open_repository)
def test_find_repository(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
x = BzrDir.open("dc")
self.assertTrue(hasattr(x.find_repository(), "uuid"))
=== modified file 'tests/test_commit.py'
--- a/tests/test_commit.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_commit.py 2007-03-25 14:41:44 +0000
@@ -14,23 +14,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from bzrlib.branch import Branch, BranchReferenceFormat, PullResult
-from bzrlib.bzrdir import BzrDir, BzrDirFormat
+from bzrlib.branch import PullResult
+from bzrlib.bzrdir import BzrDir
from bzrlib.errors import DivergedBranches
-from bzrlib.inventory import Inventory
-from bzrlib.trace import mutter
from bzrlib.workingtree import WorkingTree
import os
-import format
-import checkout
-import svn.core
-from repository import MAPPING_VERSION
from tests import TestCaseWithSubversionRepository
class TestNativeCommit(TestCaseWithSubversionRepository):
def test_simple_commit(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
self.build_tree({'dc/foo/bla': "data"})
self.client_add("dc/foo")
wt = WorkingTree.open("dc")
@@ -46,7 +40,7 @@
self.assertTrue(new_inventory.has_filename("foo/bla"))
def test_commit_message(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
self.build_tree({'dc/foo/bla': "data"})
self.client_add("dc/foo")
wt = WorkingTree.open("dc")
@@ -60,7 +54,7 @@
self.assertEqual("data", new_revision.message)
def test_commit_message_nordic(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
self.build_tree({'dc/foo/bla': "data"})
self.client_add("dc/foo")
wt = WorkingTree.open("dc")
@@ -74,7 +68,7 @@
self.assertEqual(u"\xe6\xf8\xe5", new_revision.message.decode("utf-8"))
def test_commit_update(self):
- repos_url = self.make_client('d', 'dc')
+ self.make_client('d', 'dc')
self.build_tree({'dc/foo/bla': "data"})
self.client_add("dc/foo")
wt = WorkingTree.open("dc")
=== modified file 'tests/test_convert.py'
--- a/tests/test_convert.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_convert.py 2007-03-25 14:41:44 +0000
@@ -18,7 +18,7 @@
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NotBranchError
from bzrlib.repository import Repository
-from bzrlib.tests import TestCase, TestCaseInTempDir
+from bzrlib.tests import TestCaseInTempDir
from bzrlib.trace import mutter
import os
=== modified file 'tests/test_fileids.py'
--- a/tests/test_fileids.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_fileids.py 2007-03-25 14:41:44 +0000
@@ -15,15 +15,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NoSuchRevision
-from bzrlib.inventory import Inventory, ROOT_ID
+from bzrlib.inventory import ROOT_ID
from bzrlib.repository import Repository
from bzrlib.trace import mutter
-from bzrlib.tests import TestSkipped, TestCase
+from bzrlib.tests import TestCase
import sha
-import format
from fileids import SimpleFileIdMap, generate_file_id, generate_svn_file_id
from repository import MAPPING_VERSION
from scheme import TrunkBranchingScheme
@@ -148,8 +146,8 @@
self.assertEqual(fileid, inv1.path2id("dir/file"))
self.assertEqual(repository.generate_revision_id(1, "trunk"), revid)
-def sha1(str):
- return sha.new(str).hexdigest()
+def sha1(text):
+ return sha.new(text).hexdigest()
class TestFileIdGenerator(TestCase):
def test_generate_file_id_root(self):
@@ -187,12 +185,12 @@
revids = mappings.keys()
revids.sort()
for r in revids:
- def new_file_id(x):
- if renames.has_key(r) and renames[r].has_key(x):
- return renames[r][x]
- return generate_file_id(r, x)
- revmap = SimpleFileIdMap._apply_changes(new_file_id, mappings[r], find_children)
- map.update(dict([(x,(revmap[x],r)) for x in revmap]))
+ def new_file_id(x):
+ if renames.has_key(r) and renames[r].has_key(x):
+ return renames[r][x]
+ return generate_file_id(r, x)
+ revmap = SimpleFileIdMap._apply_changes(new_file_id, mappings[r], find_children)
+ map.update(dict([(x, (revmap[x],r)) for x in revmap]))
return map
def test_simple(self):
=== modified file 'tests/test_logwalker.py'
--- a/tests/test_logwalker.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_logwalker.py 2007-03-25 14:41:44 +0000
@@ -14,13 +14,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NoSuchRevision
-from bzrlib.inventory import Inventory
import os
import logwalker
-from scheme import NoBranchingScheme, TrunkBranchingScheme
from tests import TestCaseWithSubversionRepository
from transport import SvnRaTransport
@@ -128,7 +125,7 @@
self.client_add("dc/branches")
self.client_add("dc/tags")
self.client_commit("dc", "My Message")
- self.client_copy("dc/branches/tmp", "dc/tags/tmp");
+ self.client_copy("dc/branches/tmp", "dc/tags/tmp")
self.client_commit("dc", "My Message2")
walker = logwalker.LogWalker(transport=SvnRaTransport(repos_url))
@@ -141,7 +138,7 @@
self.client_add("dc/branches")
self.client_add("dc/tags")
self.client_commit("dc", "My Message")
- self.client_copy("dc/branches/tmp", "dc/tags/tmp");
+ self.client_copy("dc/branches/tmp", "dc/tags/tmp")
self.client_commit("dc", "My Message2")
self.client_update("dc")
self.client_set_prop("dc/tags", "myprop", "mydata")
@@ -273,9 +270,9 @@
self.client_commit("dc", "My Message")
for (branch, paths, rev) in walker.follow_path("", 1):
- self.assertEqual(branch, "")
- self.assertTrue(paths.has_key("foo"))
- self.assertEqual(rev, 1)
+ self.assertEqual(branch, "")
+ self.assertTrue(paths.has_key("foo"))
+ self.assertEqual(rev, 1)
def test_follow_history_nohist(self):
repos_url = self.make_client("a", "dc")
@@ -293,9 +290,9 @@
self.client_commit("dc", "My Message")
for (branch, paths, rev) in walker.follow_path("", 1):
- self.assertEqual(branch, "")
- self.assertTrue(paths.has_key("foo"))
- self.assertEqual(rev, 1)
+ self.assertEqual(branch, "")
+ self.assertTrue(paths.has_key("foo"))
+ self.assertEqual(rev, 1)
iter = walker.follow_path("", 2)
self.assertRaises(NoSuchRevision, list, iter)
=== modified file 'tests/test_radir.py'
--- a/tests/test_radir.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_radir.py 2007-03-25 14:41:44 +0000
@@ -16,11 +16,7 @@
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NoRepositoryPresent, NotBranchError, NotLocalUrl
-from bzrlib.tests import TestCase
-from bzrlib.transport import get_transport
-from format import SvnRemoteAccess
-from repository import SvnRepository
from tests import TestCaseWithSubversionRepository
class TestRemoteAccess(TestCaseWithSubversionRepository):
=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_repos.py 2007-03-25 14:41:44 +0000
@@ -16,26 +16,21 @@
from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NoSuchRevision, BzrError, UninitializableFormat
+from bzrlib.errors import NoSuchRevision, UninitializableFormat
from bzrlib.inventory import Inventory
-import bzrlib.osutils as osutils
from bzrlib.repository import Repository
from bzrlib.revision import NULL_REVISION
from bzrlib.tests import TestCase
-from bzrlib.trace import mutter
-from bzrlib.transport.local import LocalTransport
import os
import svn.fs
from convert import load_dumpfile
-import errors
import format
from scheme import TrunkBranchingScheme, NoBranchingScheme
from transport import SvnRaTransport
from tests import TestCaseWithSubversionRepository
-import repository
from repository import (parse_svn_revision_id, generate_svn_revision_id,
svk_feature_to_revision_id, revision_id_to_svk_feature,
MAPPING_VERSION, escape_svn_path, unescape_svn_path,
=== modified file 'tests/test_transport.py'
--- a/tests/test_transport.py 2007-03-13 09:40:12 +0000
+++ b/tests/test_transport.py 2007-03-25 14:41:44 +0000
@@ -15,7 +15,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from tests import TestCaseWithSubversionRepository
-from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NotBranchError, NoSuchFile, FileExists
from transport import SvnRaTransport, bzr_to_svn_url
from unittest import TestCase
@@ -135,7 +134,7 @@
t.mkdir("bla")
self.assertRaises(FileExists, t.mkdir, "bla")
- def test_clone(self):
+ def test_clone2(self):
repos_url = self.make_client('d', 'dc')
self.build_tree({"dc/dir": None, "dc/bl": "data"})
self.client_add("dc/dir")
=== modified file 'tests/test_tree.py'
--- a/tests/test_tree.py 2007-01-14 05:22:34 +0000
+++ b/tests/test_tree.py 2007-03-25 14:41:44 +0000
@@ -14,9 +14,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NoRepositoryPresent
-from bzrlib.tests import TestCase
from bzrlib.workingtree import WorkingTree
from tree import SvnBasisTree
@@ -24,7 +21,7 @@
class TestBasisTree(TestCaseWithSubversionRepository):
def test_executable(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
self.build_tree({"dc/file": "x"})
self.client_add("dc/file")
self.client_set_prop("dc/file", "svn:executable", "*")
@@ -33,7 +30,7 @@
self.assertTrue(tree.inventory[tree.inventory.path2id("file")].executable)
def test_executable_changed(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
self.build_tree({"dc/file": "x"})
self.client_add("dc/file")
self.client_commit("dc", "executable")
@@ -43,7 +40,7 @@
self.assertFalse(tree.inventory[tree.inventory.path2id("file")].executable)
def test_symlink(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
import os
os.symlink("target", "dc/file")
self.build_tree({"dc/file": "x"})
@@ -57,7 +54,7 @@
tree.inventory[tree.inventory.path2id("file")].symlink_target)
def test_symlink_next(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
import os
os.symlink("target", "dc/file")
self.build_tree({"dc/file": "x", "dc/bla": "p"})
@@ -74,7 +71,7 @@
tree.inventory[tree.inventory.path2id("file")].symlink_target)
def test_executable_link(self):
- repos_url = self.make_client("d", "dc")
+ self.make_client("d", "dc")
import os
os.symlink("target", "dc/file")
self.build_tree({"dc/file": "x"})
=== modified file 'tests/test_upgrade.py'
--- a/tests/test_upgrade.py 2007-01-15 13:34:48 +0000
+++ b/tests/test_upgrade.py 2007-03-25 14:41:44 +0000
@@ -15,14 +15,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NoRepositoryPresent, InvalidRevisionId
+from bzrlib.errors import InvalidRevisionId
from bzrlib.repository import Repository
from bzrlib.tests import TestCase, TestCaseWithTransport
-from bzrlib.trace import mutter
from fileids import generate_svn_file_id
-import repository
-from repository import SvnRepository, MAPPING_VERSION, REVISION_ID_PREFIX
+from repository import MAPPING_VERSION
from tests import TestCaseWithSubversionRepository
from upgrade import (change_revision_parent, upgrade_repository, upgrade_branch,
UpgradeChangesContent, parse_legacy_revision_id,
@@ -259,7 +257,7 @@
oldrepos = Repository.open(repos_url)
dir = BzrDir.create("f")
- newrepos = dir.create_repository()
+ dir.create_repository()
b = dir.create_branch()
wt = dir.create_workingtree()
file("f/a", "w").write("b")
@@ -282,7 +280,7 @@
oldrepos = Repository.open(repos_url)
dir = BzrDir.create("f")
- newrepos = dir.create_repository()
+ dir.create_repository()
b = dir.create_branch()
wt = dir.create_workingtree()
file("f/a", "w").write("c")
=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py 2007-03-13 00:14:34 +0000
+++ b/tests/test_workingtree.py 2007-03-25 14:41:44 +0000
@@ -14,9 +14,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NoSuchRevision, NoSuchFile
+from bzrlib.errors import NoSuchFile
from bzrlib.inventory import Inventory, ROOT_ID
from bzrlib.revision import NULL_REVISION
from bzrlib.trace import mutter
@@ -27,10 +26,7 @@
import os
-import format
-import checkout
from repository import MAPPING_VERSION
-import tree
from tests import TestCaseWithSubversionRepository, RENAMES
class TestWorkingTree(TestCaseWithSubversionRepository):
@@ -253,7 +249,7 @@
self.client_commit("dc", "Bla")
self.build_tree({"dc/bl": "data2"})
tree = WorkingTree.open("dc")
- basis = tree.basis_tree()
+ tree.basis_tree()
delta = tree.changes_from(tree.basis_tree())
self.assertEqual("bl", delta.modified[0][0])
@@ -340,7 +336,6 @@
def test_symlink(self):
self.make_client('a', 'dc')
- import os
os.symlink("target", "dc/bla")
self.client_add("dc/bla")
tree = WorkingTree.open("dc")
@@ -386,7 +381,7 @@
self.build_tree({"dc/bl": "data"})
self.client_add("dc/bl")
tree = WorkingTree.open("dc")
- orig_tree = tree.basis_tree()
+ tree.basis_tree()
tree.commit(message_callback=lambda x: "data")
def test_commit_callback_unicode(self):
@@ -394,7 +389,7 @@
self.build_tree({"dc/bl": "data"})
self.client_add("dc/bl")
tree = WorkingTree.open("dc")
- orig_tree = tree.basis_tree()
+ tree.basis_tree()
tree.commit(message_callback=lambda x: u"data")
def test_commit_message_unicode(self):
@@ -413,7 +408,7 @@
self.make_checkout(repos_url + "/branches/foobranch", "de")
tree = WorkingTree.open("de")
self.build_tree({'de/file': "foo"})
- orig_tree = tree.basis_tree()
+ tree.basis_tree()
tree.commit(message="data")
def test_update_after_commit(self):
=== modified file 'transport.py'
--- a/transport.py 2007-01-14 23:38:09 +0000
+++ b/transport.py 2007-03-25 14:41:44 +0000
@@ -20,10 +20,6 @@
from bzrlib.transport import Transport
import bzrlib.urlutils as urlutils
-from cStringIO import StringIO
-import os
-from tempfile import mktemp
-
from svn.core import SubversionException, Pool
import svn.ra
import svn.core
@@ -110,7 +106,7 @@
mutter('opening SVN RA connection to %r' % self.svn_url)
self._ra = svn.client.open_ra_session(self.svn_url.encode('utf8'),
self._client, self.pool)
- except SubversionException, (msg, num):
+ except SubversionException, (_, num):
if num in (svn.core.SVN_ERR_RA_ILLEGAL_URL, \
svn.core.SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED, \
svn.core.SVN_ERR_BAD_URL):
=== modified file 'tree.py'
--- a/tree.py 2007-03-19 13:27:10 +0000
+++ b/tree.py 2007-03-25 14:41:44 +0000
@@ -14,16 +14,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from binascii import hexlify
-from bzrlib.bzrdir import BzrDirFormat
-from bzrlib.errors import NotBranchError, NoSuchFile
-from bzrlib.inventory import (Inventory, InventoryDirectory, InventoryFile,
- ROOT_ID)
-from bzrlib.lockable_files import TransportLock, LockableFiles
-from bzrlib.lockdir import LockDir
+from bzrlib.inventory import (Inventory, ROOT_ID)
import bzrlib.osutils as osutils
-from bzrlib.progress import DummyProgress
-from bzrlib.revision import NULL_REVISION
from bzrlib.trace import mutter
from bzrlib.revisiontree import RevisionTree
@@ -33,7 +25,7 @@
import urllib
import svn.core, svn.wc, svn.delta, svn.ra
-from svn.core import SubversionException, Pool
+from svn.core import Pool
def apply_txdelta_handler(src_stream, target_stream, pool):
assert hasattr(src_stream, 'read')
@@ -51,7 +43,7 @@
return wrapper
class SvnRevisionTree(RevisionTree):
- def __init__(self, repository, revision_id, inventory=None):
+ def __init__(self, repository, revision_id):
self._repository = repository
self._revision_id = revision_id
pool = Pool()
@@ -70,7 +62,7 @@
svn.ra.reporter2_invoke_finish_report(reporter, reporter_baton, pool)
pool.destroy()
- def get_file_lines(self, file_id):
+ def get_file_lines(self, file_id):
return osutils.split_lines(self.file_data[file_id])
=== modified file 'upgrade.py'
--- a/upgrade.py 2007-03-19 01:05:20 +0000
+++ b/upgrade.py 2007-03-25 14:41:44 +0000
@@ -96,7 +96,7 @@
try:
for path, ie in oldinv.iter_entries():
pb.update('upgrading revision', i, total)
- i+=1
+ i += 1
new_ie = ie.copy()
if new_ie.revision == oldrevid:
new_ie.revision = None
@@ -185,9 +185,9 @@
try:
for revid in graph:
pb.update('gather revision information', i, len(graph))
- i+=1
+ i += 1
try:
- (uuid, bp, rev, version) = parse_legacy_revision_id(revid)
+ (uuid, bp, rev, _) = parse_legacy_revision_id(revid)
newrevid = generate_svn_revision_id(uuid, rev, bp)
if svn_repository.has_revision(newrevid):
rename_map[revid] = newrevid
@@ -229,7 +229,7 @@
for revid in needed_revs:
pb.update('fetching new revisions', i, len(needed_revs))
repository.fetch(svn_repository, revid)
- i+=1
+ i += 1
finally:
pb.finished()
@@ -240,7 +240,7 @@
while len(needs_upgrading) > 0:
revid = needs_upgrading.pop()
pb.update('upgrading revisions', i, total)
- i+=1
+ i += 1
newrevid = create_upgraded_revid(revid)
rename_map[revid] = newrevid
if repository.has_revision(newrevid):
More information about the bazaar-commits
mailing list