~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave_commands.py

  • Committer: Robey Pointer
  • Date: 2006-07-01 19:03:33 UTC
  • mfrom: (1829 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: robey@lag.net-20060701190333-f58465aec4bd3412
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
 
25
25
from bzrlib.commands import Command
26
 
from bzrlib.trace import mutter, warning
 
26
from bzrlib.trace import warning
27
27
 
28
28
class cmd_weave_list(Command):
29
29
    """List the revision ids present in a weave, in alphabetical order"""
64
64
    takes_args = ['weave_file', 'revision_a', 'revision_b']
65
65
 
66
66
    def run(self, weave_file, revision_a, revision_b):
67
 
        from bzrlib.weavefile import read_weave, write_weave
 
67
        from bzrlib.weavefile import read_weave
68
68
        w = read_weave(file(weave_file, 'rb'))
69
69
        for state, line in w.plan_merge(revision_a, revision_b):
70
70
            # make sure to print every line with a newline, even if it doesn't
84
84
    takes_args = ['weave_file', 'revision_a', 'revision_b']
85
85
 
86
86
    def run(self, weave_file, revision_a, revision_b):
87
 
        from bzrlib.weavefile import read_weave, write_weave
 
87
        from bzrlib.weavefile import read_weave
88
88
        w = read_weave(file(weave_file, 'rb'))
89
89
        p = w.plan_merge(revision_a, revision_b)
90
90
        sys.stdout.writelines(w.weave_merge(p))