Rev 1720: Fix revert in a subversion working tree. in file:///data/jelmer/bzr-svn/trunk/
Jelmer Vernooij
jelmer at samba.org
Sat Aug 30 21:17:39 BST 2008
At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1720
revision-id: jelmer at samba.org-20080830201737-9g0g1nibbnnus194
parent: jelmer at samba.org-20080830152650-7vcb567nfs6g2ejf
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-08-30 22:17:37 +0200
message:
Fix revert in a subversion working tree.
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
TODO todo-20060729211917-2kpobww0zyvvo0j2-1
mapping.py mapping.py-20080128201303-6cp01phc0dmc0kiv-1
repository.py repository.py-20060306123302-1f8c5069b3fe0265
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'NEWS'
--- a/NEWS 2008-08-30 11:15:11 +0000
+++ b/NEWS 2008-08-30 20:17:37 +0000
@@ -18,6 +18,8 @@
* Add bzr:skip revision property to allow skipping
more detailed analysis of revisions not created by bzr.
+ * "bzr revert" in a Subversion working tree now works.
+
BUG FIXES
* Set bzr signature revision property during commit if possible.
=== modified file 'TODO'
--- a/TODO 2008-08-30 15:26:50 +0000
+++ b/TODO 2008-08-30 20:17:37 +0000
@@ -6,24 +6,20 @@
- add options in commit for create_root, create_prefix
- if create_root=False: skip _check_dirs_exist
-todo:
- generate deltas rather than fulltexts when creating file id maps
-- tests for http-specific SvnRaTransport._request_path() code
+- transform file ids in workingtree in svn-upgrade
+
+tests:
- more blackbox tests
- svn-import without scheme specified should guess
- bzr missing
-- transform file ids in workingtree in svn-upgrade
- lookup_revision_id()'s result depends on the current branching scheme,
causing weird errors when pushing
+- add tests for objects returned by WorkingTree.pull(), Branch.pull()
.svn working trees:
- implement apply_inventory_delta()
- support merge without requiring revisions to be added to svn repository
-- add tests for objects returned by WorkingTree.pull(), Branch.pull()
-- don't update all entries to the same revnum when opening working tree
-- when committing specific files in a lightweight checkout, make sure to
- also commit the file property changes for the tree root
-- faster "bzr status"
pushmerge:
- create branches/ dir automatically
=== modified file 'mapping.py'
--- a/mapping.py 2008-08-30 15:26:50 +0000
+++ b/mapping.py 2008-08-30 20:17:37 +0000
@@ -689,7 +689,7 @@
mapping_registry.register_lazy('v4', 'bzrlib.plugins.svn.mapping4',
'BzrSvnMappingv4',
'Fourth format (bzr-svn 0.5.x)')
-mapping_registry.set_default('v4')
+mapping_registry.set_default('v3')
def parse_mapping_name(name):
assert isinstance(name, str)
=== modified file 'repository.py'
--- a/repository.py 2008-08-30 03:08:49 +0000
+++ b/repository.py 2008-08-30 20:17:37 +0000
@@ -172,6 +172,7 @@
"""Repository format for Subversion repositories (accessed using svn_ra).
"""
rich_root_data = True
+ supports_tree_reference = False
def __get_matchingbzrdir(self):
from remote import SvnRemoteFormat
=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py 2008-08-30 03:44:20 +0000
+++ b/tests/test_workingtree.py 2008-08-30 20:17:37 +0000
@@ -264,7 +264,6 @@
self.client_update("dc")
tree = WorkingTree.open("dc")
os.remove("dc/bl")
- raise KnownFailure("revert not supported yet")
tree.revert(["bl"])
self.assertEqual("data", open('dc/bl').read())
=== modified file 'tree.py'
--- a/tree.py 2008-08-30 03:44:20 +0000
+++ b/tree.py 2008-08-30 20:17:37 +0000
@@ -318,3 +318,8 @@
def annotate_iter(self, file_id,
default_revision=CURRENT_REVISION):
raise NotImplementedError(self.annotate_iter)
+
+ def iter_files_bytes(self, file_ids):
+ for file_id, identifier in file_ids:
+ cur_file = (self.get_file_text(file_id),)
+ yield identifier, cur_file
=== modified file 'workingtree.py'
--- a/workingtree.py 2008-08-30 03:44:20 +0000
+++ b/workingtree.py 2008-08-30 20:17:37 +0000
@@ -27,6 +27,7 @@
from bzrlib.lockdir import LockDir
from bzrlib.revision import NULL_REVISION
from bzrlib.trace import mutter
+from bzrlib.transport import get_transport
from bzrlib.workingtree import WorkingTree, WorkingTreeFormat
from bzrlib.plugins.svn import core, properties
@@ -98,8 +99,9 @@
self.read_working_inventory()
- self.controldir = os.path.join(self.basedir, get_adm_dir(),
- 'bzr')
+ self._detect_case_handling()
+ self._transport = bzrdir.get_workingtree_transport(None)
+ self.controldir = os.path.join(bzrdir.svn_controldir, 'bzr')
try:
os.makedirs(self.controldir)
os.makedirs(os.path.join(self.controldir, 'lock'))
@@ -592,6 +594,9 @@
def _get_svk_merges(self, base_branch_props):
return base_branch_props.get(SVN_PROP_SVK_MERGE, "")
+ def apply_inventory_delta(self, delta):
+ assert delta == []
+
def set_pending_merges(self, merges):
"""See MutableTree.set_pending_merges()."""
wc = self._get_wc(write_lock=True)
@@ -724,6 +729,7 @@
self._remote_transport = None
self._remote_bzrdir = None
+ self.svn_controldir = os.path.join(self.local_path, get_adm_dir())
self.root_transport = self.transport = transport
def get_remote_bzrdir(self):
@@ -773,6 +779,10 @@
format = BzrDirFormat.get_default_format()
return not isinstance(self._format, format.__class__)
+ def get_workingtree_transport(self, format):
+ assert format is None
+ return get_transport(self.svn_controldir)
+
def create_workingtree(self, revision_id=None, hardlink=None):
"""See BzrDir.create_workingtree().
More information about the bazaar-commits
mailing list