~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-15 02:36:04 UTC
  • Revision ID: mbp@sourcefrog.net-20050515023603-7328f6cbabd2b09a
- Merge aaron's merge command

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.revision import Revision
28
28
from bzrlib import Branch, Inventory, InventoryEntry, ScratchBranch, BZRDIR, \
29
29
     format_date
 
30
from bzrlib import merge
30
31
 
31
32
 
32
33
def _squish_command_name(cmd):
881
882
    def run(self):
882
883
        print "it sure does!"
883
884
 
 
885
def parse_spec(spec):
 
886
    if '/@' in spec:
 
887
        parsed = spec.split('/@')
 
888
        assert len(parsed) == 2
 
889
        if parsed[1] == "":
 
890
            parsed[1] = -1
 
891
        else:
 
892
            parsed[1] = int(parsed[1])
 
893
            assert parsed[1] >=0
 
894
    else:
 
895
        parsed = [spec, None]
 
896
    return parsed
 
897
 
 
898
class cmd_merge(Command):
 
899
    """Perform a three-way merge of trees."""
 
900
    takes_args = ['other_spec', 'base_spec']
 
901
 
 
902
    def run(self, other_spec, base_spec):
 
903
        merge.merge(parse_spec(other_spec), parse_spec(base_spec))
884
904
 
885
905
class cmd_assert_fail(Command):
886
906
    """Test reporting of assertion failures"""