Rev 2324: Use convenience functions in a couple more places. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5
Jelmer Vernooij
jelmer at samba.org
Sat Jan 17 15:38:45 GMT 2009
At http://people.samba.org/bzr/jelmer/bzr-svn/0.5
------------------------------------------------------------
revno: 2324
revision-id: jelmer at samba.org-20090117153842-yj8g67bp1jgmokmp
parent: jelmer at samba.org-20090117151214-x5b17bhpxscsl28b
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Sat 2009-01-17 16:38:42 +0100
message:
Use convenience functions in a couple more places.
modified:
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
=== modified file 'tree.py'
--- a/tree.py 2009-01-15 01:28:44 +0000
+++ b/tree.py 2009-01-17 15:38:42 +0000
@@ -29,6 +29,8 @@
from subvertpy import delta, wc, NODE_DIR, properties
+from bzrlib.plugins.svn.fileids import idmap_lookup
+
def inventory_add_external(inv, parent_id, path, revid, ref_revnum, url):
"""Add an svn:externals entry to an inventory as a tree-reference.
@@ -105,7 +107,7 @@
self.revnum = revnum
def open_root(self, revnum):
- file_id, revision_id = self.tree.id_map[""]
+ file_id, revision_id = idmap_lookup(self.tree.id_map, "")
ie = self.tree._inventory.add_path("", 'directory', file_id)
ie.revision = revision_id
return DirectoryTreeEditor(self.tree, file_id)
@@ -124,7 +126,7 @@
def add_directory(self, path, copyfrom_path=None, copyfrom_revnum=-1):
path = path.decode("utf-8")
- file_id, revision_id = self.tree.id_map[path]
+ file_id, revision_id = idmap_lookup(self.tree.id_map, path)
ie = self.tree._inventory.add_path(path, 'directory', file_id)
ie.revision = revision_id
return DirectoryTreeEditor(self.tree, file_id)
@@ -181,7 +183,7 @@
mutter('unsupported file property %r', name)
def close(self, checksum=None):
- file_id, revision_id = self.tree.id_map[self.path]
+ file_id, revision_id = idmap_lookup(self.tree.id_map, self.path)
if self.file_stream:
self.file_stream.seek(0)
@@ -261,7 +263,7 @@
if entry.schedule in (wc.SCHEDULE_NORMAL,
wc.SCHEDULE_DELETE,
wc.SCHEDULE_REPLACE):
- return self.id_map[workingtree.branch.unprefix(relpath.decode("utf-8"))]
+ return idmap_lookup(self.id_map, workingtree.branch.unprefix(relpath.decode("utf-8")))
return (None, None)
def add_dir_to_inv(relpath, adm, parent_id):
More information about the bazaar-commits
mailing list