/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/weave_commands.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-08 14:55:19 UTC
  • mfrom: (3530 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3532.
  • Revision ID: john@arbash-meinel.com-20080708145519-paqg4kjwbpgs2xmq
Merge bzr.dev 3530

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        from bzrlib.weavefile import read_weave
37
37
        from bzrlib.transport import get_transport
38
38
        from bzrlib import osutils
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)
44
 
        else:
45
 
            vf = read_weave(file(filename, 'rb'))
 
39
        vf = read_weave(file(filename, 'rb'))
46
40
        names = vf.versions()
47
41
        names.sort()
48
42
        print '\n'.join(names)
49
43
 
50
44
 
51
 
class cmd_weave_join(Command):
52
 
    """Join the contents of two weave files.
53
 
 
54
 
    The resulting weave is sent to stdout.
55
 
 
56
 
    This command is only intended for bzr developer use.
57
 
    """
58
 
 
59
 
    hidden = True
60
 
    takes_args = ['weave1', 'weave2']
61
 
 
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'))
66
 
        w1.join(w2)
67
 
        write_weave(w1, sys.stdout)
68
 
 
69
 
 
70
45
class cmd_weave_plan_merge(Command):
71
46
    """Show the plan for merging two versions within a weave"""
72
47
    hidden = True