Rev 1104: Merge 0.4. in http://people.samba.org/bzr/jelmer/bzr-svn/cext
Jelmer Vernooij
jelmer at samba.org
Tue Jun 17 23:36:16 BST 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/cext
------------------------------------------------------------
revno: 1104
revision-id: jelmer at samba.org-20080617223611-u7llhl0o1hfk80uo
parent: jelmer at samba.org-20080617210009-b7q38wpl87b6y309
parent: jelmer at samba.org-20080617223119-ub4cxwjhnya05p5n
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: cext
timestamp: Wed 2008-06-18 00:36:11 +0200
message:
Merge 0.4.
modified:
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
mapping3/__init__.py __init__.py-20080502174630-9324zh25kka98vlw-1
tests/__init__.py __init__.py-20060508151940-e9f4d914801a2535
tests/test_fetch.py test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
------------------------------------------------------------
revno: 950.3.179
revision-id: jelmer at samba.org-20080617223119-ub4cxwjhnya05p5n
parent: jelmer at samba.org-20080617222600-mwb5selnhivyzmtu
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-06-18 00:31:19 +0200
message:
Cherrypick some changes from the cext branch.
modified:
format.py format.py-20070917005147-94kb7zysotf82kqw-1
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
------------------------------------------------------------
revno: 950.3.178
revision-id: jelmer at samba.org-20080617222600-mwb5selnhivyzmtu
parent: jelmer at samba.org-20080617222130-x7hg1cok27gp6qme
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-06-18 00:26:00 +0200
message:
Rename baton to editor, which is more appropriate for the OO interface.
modified:
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
------------------------------------------------------------
revno: 950.3.177
revision-id: jelmer at samba.org-20080617222130-x7hg1cok27gp6qme
parent: jelmer at samba.org-20080617210310-x1uzjw4hry0x252d
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-06-18 00:21:30 +0200
message:
More object oriented editor interface.
modified:
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
mapping3/__init__.py __init__.py-20080502174630-9324zh25kka98vlw-1
ra.py ra.py-20080615005305-t5221niknu8rm6bt-1
tests/__init__.py __init__.py-20060508151940-e9f4d914801a2535
tests/test_fetch.py test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
------------------------------------------------------------
revno: 950.3.176
revision-id: jelmer at samba.org-20080617210310-x1uzjw4hry0x252d
parent: jelmer at samba.org-20080617205523-hqus05shap15g9yc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Tue 2008-06-17 23:03:10 +0200
message:
Specify paths explicitly to do_update and do_switch.
modified:
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
ra.py ra.py-20080615005305-t5221niknu8rm6bt-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
=== modified file 'commit.py'
--- a/commit.py 2008-06-17 21:00:09 +0000
+++ b/commit.py 2008-06-17 22:36:11 +0000
@@ -190,7 +190,7 @@
:param file_id: Id of the file to modify.
:param contents: Contents of the file.
- :param file_editor: Editor for this file
+ :param file_editor: Subversion FileEditor object.
"""
assert file_editor is not None
txdelta = file_editor.apply_textdelta(None)
@@ -204,7 +204,7 @@
:param path: Path (from repository root) to the directory.
:param file_id: File id of the directory
- :param dir_editor: Editor for the directory.
+ :param dir_editor: Subversion DirEditor object.
"""
assert dir_editor is not None
# Loop over entries of file_id in self.old_inv
@@ -221,7 +221,7 @@
child_ie.parent_id != self.new_inventory[child_ie.file_id].parent_id or
# ... name changed
self.new_inventory[child_ie.file_id].name != child_name):
- self.mutter('removing %r(%r)', child_name, child_ie.file_id)
+ self.mutter('removing %r(%r)', (child_name, child_ie.file_id))
dir_editor.delete_entry(
urlutils.join(self.branch.get_branch_path(), path, child_name),
self.base_revnum)
@@ -240,7 +240,9 @@
# add them if they didn't exist in old_inv
if not child_ie.file_id in self.old_inv:
self.mutter('adding %s %r', child_ie.kind, new_child_path)
- child_editor = dir_editor.add_file(full_new_child_path)
+ child_editor = dir_editor.add_file(
+ full_new_child_path, None, -1)
+
# copy if they existed at different location
elif (self.old_inv.id2path(child_ie.file_id) != new_child_path or
@@ -257,7 +259,8 @@
elif child_ie.revision is None:
self.mutter('open %s %r', child_ie.kind, new_child_path)
- child_editor = dir_editor.open_file(full_new_child_path, self.base_revnum)
+ child_editor = dir_editor.open_file(
+ full_new_child_path, self.base_revnum)
else:
# Old copy of the file was retained. No need to send changes
@@ -277,7 +280,8 @@
value = properties.PROP_EXECUTABLE_VALUE
else:
value = None
- child_editor.change_prop(properties.PROP_EXECUTABLE, value)
+ child_editor.change_prop(
+ properties.PROP_EXECUTABLE, value)
if old_special != (child_ie.kind == 'symlink'):
if child_ie.kind == 'symlink':
@@ -285,7 +289,8 @@
else:
value = None
- child_editor.change_prop(properties.PROP_SPECIAL, value)
+ child_editor.change_prop(
+ properties.PROP_SPECIAL, value)
# handle the file
if child_ie.file_id in self.modified_files:
@@ -293,7 +298,7 @@
self.modified_files[child_ie.file_id], child_editor)
if child_editor is not None:
- child_editor.close()
+ child_editor.close(None)
# Loop over subdirectories of file_id in self.new_inventory
for child_name in self.new_inventory[file_id].children:
@@ -307,7 +312,7 @@
self.mutter('adding dir %r', child_ie.name)
child_editor = dir_editor.add_directory(
urlutils.join(self.branch.get_branch_path(),
- new_child_path))
+ new_child_path), None, -1)
# copy if they existed at different location
elif self.old_inv.id2path(child_ie.file_id) != new_child_path:
@@ -354,7 +359,8 @@
# Open paths leading up to branch
for i in range(0, len(elements)-1):
# Does directory already exist?
- ret.append(ret[-1].open_directory("/".join(existing_elements[0:i+1]), -1))
+ ret.append(ret[-1].open_directory(
+ "/".join(existing_elements[0:i+1]), -1))
if (len(existing_elements) != len(elements) and
len(existing_elements)+1 != len(elements)):
=== modified file 'mapping3/__init__.py'
--- a/mapping3/__init__.py 2008-06-15 02:20:20 +0000
+++ b/mapping3/__init__.py 2008-06-17 22:36:11 +0000
@@ -120,7 +120,8 @@
def set_property_scheme(repository, scheme):
editor = repository.transport.get_commit_editor(
- {properties.PROP_REVISION_LOG: "Updating branching scheme for Bazaar."})
+ {properties.PROP_REVISION_LOG: "Updating branching scheme for Bazaar."},
+ done, None, False)
root = editor.open_root()
root.change_prop(SVN_PROP_BZR_BRANCHING_SCHEME,
"".join(map(lambda x: x+"\n", scheme.branch_list)).encode("utf-8"))
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2008-06-15 02:20:20 +0000
+++ b/tests/__init__.py 2008-06-17 22:36:11 +0000
@@ -229,11 +229,11 @@
def commit_editor(self, url, message="Test commit"):
ra = RemoteAccess(url.encode('utf8'))
class CommitEditor:
- def __init__(self, ra, edit_baton, base_revnum, base_url):
+ def __init__(self, ra, editor, base_revnum, base_url):
self._used = False
self.ra = ra
self.base_revnum = base_revnum
- self.edit_baton = edit_baton
+ self.editor = editor
self.data = {}
self.create = set()
self.props = {}
@@ -311,31 +311,31 @@
if subpath in self.create:
child_baton = dir_baton.add_file(subpath, None, -1)
else:
- child_baton = dir_baton.open_file(subpath, -1)
+ child_baton = dir_baton.open_file(subpath)
if isinstance(contents, str):
txdelta = child_baton.apply_textdelta(None)
txdelta_send_stream(StringIO(contents), txdelta)
if subpath in self.props:
for k, v in self.props[subpath].items():
child_baton.change_prop(k, v)
- child_baton.close(None)
+ child_baton.close()
def done(self):
assert self._used == False
self._used = True
- root_baton = self.edit_baton.open_root(self.base_revnum)
+ root_baton = self.editor.open_root(self.base_revnum)
self._process_dir(root_baton, self.data, "")
root_baton.close()
- self.edit_baton.close()
+ self.editor.close()
- my_revnum = self.ra.get_latest_revnum()
+ my_revnum = ra.get_latest_revnum()
assert my_revnum > self.base_revnum
return my_revnum
base_revnum = ra.get_latest_revnum()
- edit_baton = ra.get_commit_editor({"svn:log": message})
- return CommitEditor(ra, edit_baton, base_revnum, url)
+ editor = ra.get_commit_editor({"svn:log": message})
+ return CommitEditor(ra, editor, base_revnum, url)
def test_suite():
=== modified file 'tests/test_fetch.py'
--- a/tests/test_fetch.py 2008-06-15 02:54:00 +0000
+++ b/tests/test_fetch.py 2008-06-17 22:36:11 +0000
@@ -1551,10 +1551,10 @@
pass
editor = ra.get_commit_editor({"svn:log": "msg"}, done, None, False)
root_baton = editor.open_root(1)
- baton = editor.open_file("mylink", root_baton, 1)
- editor.change_file_prop(baton, "svn:special", "*")
- editor.close_file(baton, None)
- editor.close_directory(root_baton)
+ baton = root_baton.open_file("mylink", 1)
+ baton.change_prop("svn:special", "*")
+ baton.close()
+ root_baton.close()
editor.close()
oldrepos = Repository.open("svn+"+repos_url)
dir = BzrDir.create("f", format.get_rich_root_format())
=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py 2008-06-17 20:27:33 +0000
+++ b/tests/test_workingtree.py 2008-06-17 22:36:11 +0000
@@ -27,6 +27,7 @@
from bzrlib.workingtree import WorkingTree
from bzrlib.plugins.svn import core, wc
+
from bzrlib.plugins.svn.transport import svn_config
from bzrlib.plugins.svn.tests import TestCaseWithSubversionRepository
from bzrlib.plugins.svn.workingtree import generate_ignore_list
=== modified file 'transport.py'
--- a/transport.py 2008-06-17 21:00:09 +0000
+++ b/transport.py 2008-06-17 22:36:11 +0000
@@ -207,10 +207,10 @@
finally:
self.add_connection(conn)
- def do_switch(self, switch_rev, recurse, switch_url, editor):
+ def do_switch(self, switch_rev, path, recurse, switch_url, editor):
conn = self._open_real_transport()
self.mutter('svn do-switch -r%d %s' % (switch_rev, switch_url))
- return conn.do_switch(switch_rev, "", recurse, switch_url, editor)
+ return conn.do_switch(switch_rev, path, recurse, switch_url, editor)
def iter_log(self, paths, from_revnum, to_revnum, limit, discover_changed_paths,
strict_node_history, revprops):
@@ -368,10 +368,10 @@
finally:
self.add_connection(conn)
- def do_update(self, revnum, recurse, editor):
+ def do_update(self, revnum, path, recurse, editor):
conn = self._open_real_transport()
self.mutter('svn do-update -r%d' % (revnum,))
- return conn.do_update(revnum, "", recurse, editor)
+ return conn.do_update(revnum, path, recurse, editor)
def has_capability(self, cap):
conn = self.get_connection()
More information about the bazaar-commits
mailing list