Merge lp:~abentley/wikkid/branch-file-store into lp:wikkid

Proposed by Aaron Bentley on 2011-06-30
Status: Merged
Merged at revision: 68
Proposed branch: lp:~abentley/wikkid/branch-file-store
Merge into: lp:wikkid
Diff against target: 36 lines (+5/-4)
1 file modified
wikkid/filestore/bzr.py (+5/-4)
To merge this branch: bzr merge lp:~abentley/wikkid/branch-file-store
Reviewer Review Type Date Requested Status
Wikkid Hackers 2011-06-30 Pending
Review via email: mp+66503@code.launchpad.net

Commit message

Fix file-id creation.

Description of the change

Here's the fix for the file-ids. Sorry about that.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wikkid/filestore/bzr.py'
2--- wikkid/filestore/bzr.py 2011-06-30 16:04:37 +0000
3+++ wikkid/filestore/bzr.py 2011-06-30 17:26:51 +0000
4@@ -12,6 +12,7 @@
5 from zope.interface import implements
6
7 from bzrlib.errors import BinaryFile, MalformedTransform
8+from bzrlib.generate_ids import gen_file_id
9 from bzrlib.merge3 import Merge3
10 from bzrlib.osutils import splitpath, split_lines
11 from bzrlib.revision import NULL_REVISION
12@@ -69,12 +70,11 @@
13 prev_trans_id = trans_id
14 for parent_path, tail in iter_paths(path):
15 trans_id = tt.trans_id_tree_path(parent_path)
16- tt.adjust_path(tail, trans_id, prev_trans_id)
17 if tt.tree_kind(trans_id) is not None:
18 break
19+ tt.adjust_path(tail, trans_id, prev_trans_id)
20 tt.create_directory(trans_id)
21- tt.version_file(trans_id, trans_id)
22- prev_name = tail
23+ tt.version_file(gen_file_id(tail), trans_id)
24 prev_trans_id = trans_id
25
26
27@@ -348,7 +348,8 @@
28 if tt.tree_kind(trans_id) is not None:
29 tt.delete_contents(trans_id)
30 else:
31- tt.version_file(trans_id, trans_id)
32+ name = splitpath(path)[-1]
33+ tt.version_file(gen_file_id(name), trans_id)
34 create_parents(tt, path, trans_id)
35 tt.create_file(content, trans_id)
36 try:

Subscribers

People subscribed via source and target branches