Rev 180: Include the full set of values that are given from iter_changes. in http://bazaar.launchpad.net/~jameinel/bzr-explorer/wt_model
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 9 20:16:04 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr-explorer/wt_model
------------------------------------------------------------
revno: 180
revision-id: john at arbash-meinel.com-20090709191558-63uuu9670ku37uth
parent: john at arbash-meinel.com-20090709190330-ipcab6h6oh62awry
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: wt_model
timestamp: Thu 2009-07-09 14:15:58 -0500
message:
Include the full set of values that are given from iter_changes.
-------------- next part --------------
=== modified file 'lib/wt_model.py'
--- a/lib/wt_model.py 2009-07-09 19:03:30 +0000
+++ b/lib/wt_model.py 2009-07-09 19:15:58 +0000
@@ -32,17 +32,26 @@
:type children: A list of _WTItem objects
"""
- def __init__(self, path, name, kind, file_id, old_kind, parent):
+ def __init__(self, file_id, is_modified, path, name, kind, versioned,
+ executable, parent, old_path, old_name, old_kind,
+ was_versioned, old_parent_id):
"""Create a new _WTItem
"""
+ self.file_id = file_id
self.path = path
self.name = name
self.kind = kind
- self.file_id = file_id
+ self.versioned = versioned
+ self.is_modified = is_modified
+ self.executable = executable
+ self.parent = parent
+ self.old_path = old_path
self.old_kind = old_kind
+ self.old_name = old_name
+ self.was_versioned = was_versioned
+ self.old_parent_id = old_parent_id
# Note: this creates a cyclical reference, consider using parent
# instead
- self.parent = parent
self.children = []
self.status = None
@@ -60,7 +69,7 @@
# By file-id
dir_by_id = {}
dir_by_path = {}
- for (file_id, paths, did_change, versions, parents, names, kinds,
+ for (file_id, paths, did_change, versions, parent_ids, names, kinds,
executables) in changes:
if file_id is None:
# not versioned
@@ -69,14 +78,16 @@
raise ValueError('not supported yet')
parent = dir_by_path[parent_dir]
else:
- if parents[1] is None: # Root entry
+ if parent_ids[1] is None: # Root entry
# Or maybe this happens for unversioned files?
assert names[1] == ''
parent = self
else:
- parent = dir_by_id[parents[1]]
- item = _WTItem(paths[1], names[1], kinds[1], file_id, kinds[0],
- parent)
+ parent = dir_by_id[parent_ids[1]]
+ item = _WTItem(file_id, did_change, paths[1], names[1], kinds[1],
+ versions[1], executables[1], parent,
+ paths[0], names[0], kinds[0], versions[0],
+ parent_ids[0])
parent.children.append(item)
if kinds[1] == 'directory':
dir_by_id[file_id] = item
@@ -90,7 +101,7 @@
basis_tree = wt.basis_tree()
basis_tree.lock_read()
try:
- root_wt_item = cls(None, None, None, None, None, None)
+ root_wt_item = cls(*([None]*13))
changes = wt.iter_changes(basis_tree, include_unchanged=True,
require_versioned=False, want_unversioned=True)
root_wt_item._from_iter_changes(changes)
More information about the bazaar-commits
mailing list