/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/commands.py

  • Committer: Aaron Bentley
  • Date: 2005-07-29 17:19:16 UTC
  • mto: (1092.1.41) (1185.3.4) (974.1.47)
  • mto: This revision was merged to the branch mainline in revision 1020.
  • Revision ID: abentley@panoramicfeedback.com-20050729171916-322fd81b451d2e3e
Added merge-type parameter to merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
    return revs
123
123
 
124
124
 
 
125
def get_merge_type(typestring):
 
126
    """Attempt to find the merge class/factory associated with a string."""
 
127
    from merge import merge_types
 
128
    try:
 
129
        return merge_types[typestring][0]
 
130
    except KeyError:
 
131
        templ = '%s%%7s: %%s' % (' '*12)
 
132
        lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
 
133
        type_list = '\n'.join(lines)
 
134
        msg = "No known merge type %s. Supported types are:\n%s" %\
 
135
            (typestring, type_list)
 
136
        raise BzrCommandError(msg)
 
137
    
 
138
 
125
139
 
126
140
def _get_cmd_dict(plugins_override=True):
127
141
    d = {}
1393
1407
    --force is given.
1394
1408
    """
1395
1409
    takes_args = ['other_spec', 'base_spec?']
1396
 
    takes_options = ['force']
 
1410
    takes_options = ['force', 'merge-type']
1397
1411
 
1398
 
    def run(self, other_spec, base_spec=None, force=False):
 
1412
    def run(self, other_spec, base_spec=None, force=False, merge_type=None):
1399
1413
        from bzrlib.merge import merge
 
1414
        from bzrlib.merge_core import ApplyMerge3
 
1415
        if merge_type is None:
 
1416
            merge_type = ApplyMerge3
1400
1417
        merge(parse_spec(other_spec), parse_spec(base_spec),
1401
 
              check_clean=(not force))
 
1418
              check_clean=(not force), merge_type=merge_type)
1402
1419
 
1403
1420
 
1404
1421
 
1500
1517
    'long':                   None,
1501
1518
    'root':                   str,
1502
1519
    'no-backup':              None,
 
1520
    'merge-type':             get_merge_type,
1503
1521
    }
1504
1522
 
1505
1523
SHORT_OPTIONS = {