36
36
from bzrlib.weavefile import read_weave
37
37
from bzrlib.transport import get_transport
38
38
from bzrlib import osutils
39
vf = read_weave(file(filename, 'rb'))
39
from bzrlib.knit import KnitVersionedFile
40
if filename.endswith('.knit'):
41
transport = get_transport(osutils.dirname(filename))
42
relpath = osutils.basename(filename)[:-len('.knit')]
43
vf = KnitVersionedFile(relpath, transport)
45
vf = read_weave(file(filename, 'rb'))
40
46
names = vf.versions()
42
48
print '\n'.join(names)
51
class cmd_weave_join(Command):
52
"""Join the contents of two weave files.
54
The resulting weave is sent to stdout.
56
This command is only intended for bzr developer use.
60
takes_args = ['weave1', 'weave2']
62
def run(self, weave1, weave2):
63
from bzrlib.weavefile import read_weave, write_weave
64
w1 = read_weave(file(weave1, 'rb'))
65
w2 = read_weave(file(weave2, 'rb'))
67
write_weave(w1, sys.stdout)
45
70
class cmd_weave_plan_merge(Command):
46
71
"""Show the plan for merging two versions within a weave"""