Rev 2319: Merge 0.5. in file:///data/jelmer/bzr-svn/fileids/
Jelmer Vernooij
jelmer at samba.org
Sat Jan 17 15:35:40 GMT 2009
At file:///data/jelmer/bzr-svn/fileids/
------------------------------------------------------------
revno: 2319
revision-id: jelmer at samba.org-20090117153538-lsswxlhyjtnq7o0v
parent: jelmer at samba.org-20090117043000-8rctwtzveel7vmjx
parent: jelmer at samba.org-20090117151214-x5b17bhpxscsl28b
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: fileids
timestamp: Sat 2009-01-17 16:35:38 +0100
message:
Merge 0.5.
modified:
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
fileids.py fileids.py-20060714013623-u5iiyqqnko11grcf-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
------------------------------------------------------------
revno: 2314.1.9
revision-id: jelmer at samba.org-20090117151214-x5b17bhpxscsl28b
parent: jelmer at samba.org-20090117031216-ll7fx2osdz3iuwmo
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Sat 2009-01-17 16:12:14 +0100
message:
Add convenience lookup function for idmaps.
modified:
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
fileids.py fileids.py-20060714013623-u5iiyqqnko11grcf-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'fetch.py'
--- a/fetch.py 2009-01-17 03:12:16 +0000
+++ b/fetch.py 2009-01-17 15:12:14 +0000
@@ -35,7 +35,7 @@
from subvertpy.delta import apply_txdelta_handler
from bzrlib.plugins.svn.errors import InvalidFileName, FileIdMapIncomplete
-from bzrlib.plugins.svn.fileids import get_local_changes
+from bzrlib.plugins.svn.fileids import get_local_changes, idmap_lookup
from bzrlib.plugins.svn.foreign import escape_commit_message
from bzrlib.plugins.svn.mapping import SVN_PROP_BZR_PREFIX
from bzrlib.plugins.svn.repository import SvnRepository, SvnRepositoryFormat
@@ -728,10 +728,10 @@
return False
def _get_old_id(self, path):
- return self._parent_idmap[path][0]
+ return idmap_lookup(self._parent_idmap, path)[0]
def _get_new_id(self, path):
- return self._idmap[path][0]
+ return idmap_lookup(self._idmap, path)[0]
def report_inventory_contents(reporter, revnum, start_empty):
=== modified file 'fileids.py'
--- a/fileids.py 2009-01-17 04:30:00 +0000
+++ b/fileids.py 2009-01-17 15:35:38 +0000
@@ -37,6 +37,16 @@
# idmap delta: dictionary mapping unicode paths to new file id assignments
# text revision map: dictionary mapping unicode paths to text revisions (usually revision ids)
+def idmap_lookup(idmap, path):
+ """Lookup a path in an idmap.
+
+ :param idmap: The idmap to look up in.
+ :param path: Path to look up
+ :return: Tuple with file id and text revision
+ """
+ return idmap[path]
+
+
def determine_text_revisions(changes, default_revid, specific_revids):
"""Create a text revision map.
=== modified file 'workingtree.py'
--- a/workingtree.py 2009-01-15 01:28:44 +0000
+++ b/workingtree.py 2009-01-17 15:12:14 +0000
@@ -63,6 +63,7 @@
)
from bzrlib.plugins.svn.branch import SvnBranch
from bzrlib.plugins.svn.commit import _revision_id_to_svk_feature
+from bzrlib.plugins.svn.fileids import idmap_lookup
from bzrlib.plugins.svn.format import get_rich_root_format
from bzrlib.plugins.svn.mapping import escape_svn_path
from bzrlib.plugins.svn.remote import SvnRemoteAccess
@@ -280,7 +281,7 @@
assert isinstance(path, str)
rp = self.branch.unprefix(path)
- entry = self.basis_tree().id_map[rp.decode("utf-8")]
+ entry = idmap_lookup(self.basis_tree().id_map, rp.decode("utf-8"))
assert entry[0] is not None
assert isinstance(entry[0], str), "fileid %r for %r is not a string" % (entry[0], path)
return entry
More information about the bazaar-commits
mailing list