~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-13 20:33:57 UTC
  • mfrom: (2283 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2294.
  • Revision ID: john@arbash-meinel.com-20070213203357-b7yg41mi9sk6cqd0
[merge] bzr.dev 2283
resolve conflicts in moved repository formats
small issue with osutils.contains_whitespace()

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib import (
23
23
    osutils,
 
24
    registry,
24
25
    )
25
26
from bzrlib.branch import Branch
26
27
from bzrlib.conflicts import ConflictList, Conflict
141
142
 
142
143
    def check_basis(self, check_clean, require_commits=True):
143
144
        if self.this_basis is None and require_commits is True:
144
 
            raise BzrCommandError("This branch has no commits")
 
145
            raise BzrCommandError("This branch has no commits."
 
146
                                  " (perhaps you would prefer 'bzr pull')")
145
147
        if check_clean:
146
148
            self.compare_basis()
147
149
            if self.this_basis != self.this_rev_id:
960
962
    merger.other_basis = other_rev_id
961
963
    return merger.do_merge()
962
964
 
963
 
 
964
 
merge_types = {     "merge3": (Merge3Merger, "Native diff3-style merge"), 
965
 
                     "diff3": (Diff3Merger,  "Merge using external diff3"),
966
 
                     'weave': (WeaveMerger, "Weave-based merge")
967
 
              }
968
 
 
969
 
 
970
 
def merge_type_help():
971
 
    templ = '%s%%7s: %%s' % (' '*12)
972
 
    lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
973
 
    return '\n'.join(lines)
 
965
def get_merge_type_registry():
 
966
    """Merge type registry is in bzrlib.option to avoid circular imports.
 
967
 
 
968
    This method provides a sanctioned way to retrieve it.
 
969
    """
 
970
    from bzrlib import option
 
971
    return option._merge_type_registry