~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2006-08-09 16:42:10 UTC
  • mto: This revision was merged to the branch mainline in revision 1911.
  • Revision ID: abentley@panoramicfeedback.com-20060809164210-3945898670a299ca
Merge takes --uncommitted parameter

Show diffs side-by-side

added added

removed removed

Lines of Context:
2123
2123
    takes_args = ['branch?']
2124
2124
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2125
2125
                     Option('show-base', help="Show base revision text in "
2126
 
                            "conflicts")]
 
2126
                            "conflicts"), 
 
2127
                     Option('uncommitted', help='Apply uncommitted changes'
 
2128
                            ' from a working copy, instead of branch changes')]
2127
2129
 
2128
2130
    def help(self):
2129
2131
        from merge import merge_type_help
2131
2133
        return getdoc(self) + '\n' + merge_type_help() 
2132
2134
 
2133
2135
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2134
 
            show_base=False, reprocess=False, remember=False):
 
2136
            show_base=False, reprocess=False, remember=False, 
 
2137
            uncommitted=False):
2135
2138
        if merge_type is None:
2136
2139
            merge_type = Merge3Merger
2137
2140
 
2153
2156
        branch = self._get_remembered_parent(tree, branch, 'Merging from')
2154
2157
 
2155
2158
        if revision is None or len(revision) < 1:
2156
 
            base = [None, None]
2157
 
            other = [branch, -1]
 
2159
            if uncommitted:
 
2160
                base = [branch, -1]
 
2161
                other = [branch, None]
 
2162
            else:
 
2163
                base = [None, None]
 
2164
                other = [branch, -1]
2158
2165
            other_branch, path = Branch.open_containing(branch)
2159
2166
        else:
 
2167
            if uncommitted:
 
2168
                raise BzrCommandError('Cannot use --uncommitted and --revision'
 
2169
                                      ' at the same time.')
2160
2170
            if len(revision) == 1:
2161
2171
                base = [None, None]
2162
2172
                other_branch, path = Branch.open_containing(branch)