<p>You must .lock_write a memory tree to do anything with it.</p>
<p>John<br>
=:-></p>
<div class="gmail_quote">On Apr 11, 2012 8:27 AM, "INADA Naoki" <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you for quick reply.<br>
<br>
I try MemoryTree with IPython but I still can't make commit.<br>
<br>
<br>
In [41]: mt = bzrlib.memorytree.MemoryTree.create_on_branch(bzrlib.branch.Branch.open('.'))<br>
In [42]: mt.list_files()<br>
---------------------------------------------------------------------------<br>
NotImplementedError Traceback (most recent call last)<br>
/home/inada-n/work/bzr/bzr/<ipython-input-42-21b2fa0b439e> in <module>()<br>
----> 1 mt.list_files()<br>
<br>
/home/inada-n/local/python/lib/python2.7/site-packages/bzrlib/tree.pyc<br>
in list_files(self, include_root, from_dir, recursive)<br>
205 inventory entry)<br>
206 """<br>
--> 207 raise NotImplementedError(self.list_files)<br>
208<br>
209 def iter_references(self):<br>
<br>
NotImplementedError: <bound method MemoryTree.list_files of<br>
<bzrlib.memorytree.MemoryTree object at 0x2ed6a90>><br>
<br>
In [47]: t=mt._file_transport<br>
In [51]: t.put_bytes("testfile", "testtest")<br>
Out[51]: 8<br>
In [52]: mt.add("testfile")<br>
In [55]: mt.commit(message="test commit")<br>
Out[55]: 'songofacandy@gmail.com-20120411061113-ica4hlqmifnuttdy'<br>
In [57]: !bzr diff -c-1<br>
<no outout><br>
<br>
<br>
<br>
On Wed, Apr 11, 2012 at 2:35 PM, John Meinel <<a href="mailto:john@arbash-meinel.com">john@arbash-meinel.com</a>> wrote:<br>
> You may want to look at MemoryTree. I don't think it would scale to huge<br>
> trees, but it does support commit and rename, I believe.<br>
><br>
> John<br>
> =:-><br>
><br>
> On Apr 11, 2012 6:49 AM, "INADA Naoki" <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>> wrote:<br>
>><br>
>> I want to write web based html editor with bazaar backend.<br>
>> I found wikkid uses TransformPreview for using bazaar branch as a backend.<br>
>><br>
>> But TransformPreview doesn't provide any tutorial for making commit and<br>
>> it's API is not easy to understand. For example, how to make trans_id<br>
>> for second argument of TransformPreview.new_file? How I can rename file?<br>
>><br>
>> Does Bazaar provide more easy way to make commit without workingtree?<br>
>><br>
>> --<br>
>> INADA Naoki <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>><br>
>><br>
><br>
<br>
<br>
<br>
--<br>
INADA Naoki <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>><br>
</blockquote></div>