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

  • Committer: Jan Hudec
  • Date: 2006-11-25 20:38:39 UTC
  • mto: (2199.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2200.
  • Revision ID: bulb@ucw.cz-20061125203839-9nuhv32z63hb8811
Option --pull for merge command.

Option --pull was added to merge command, that, if the merge would be
trivial, ie. if the common ancestor is equal to the local tip, causes pull of
the remote instead of creating the merger.

Simple test for this option is included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2197
2197
                     Option('show-base', help="Show base revision text in "
2198
2198
                            "conflicts"), 
2199
2199
                     Option('uncommitted', help='Apply uncommitted changes'
2200
 
                            ' from a working copy, instead of branch changes')]
 
2200
                            ' from a working copy, instead of branch changes'),
 
2201
                     Option('pull', help='If the branches are not diverged,'
 
2202
                            ' chage to remote revision as via pull command'),
 
2203
                     ]
2201
2204
 
2202
2205
    def help(self):
2203
2206
        from inspect import getdoc
2205
2208
 
2206
2209
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2207
2210
            show_base=False, reprocess=False, remember=False, 
2208
 
            uncommitted=False):
 
2211
            uncommitted=False, pull=False):
2209
2212
        if merge_type is None:
2210
2213
            merge_type = _mod_merge.Merge3Merger
2211
2214
 
2276
2279
                    merge_type=merge_type,
2277
2280
                    reprocess=reprocess,
2278
2281
                    show_base=show_base,
 
2282
                    pull=pull,
2279
2283
                    pb=pb, file_list=interesting_files)
2280
2284
            finally:
2281
2285
                pb.finished()
2932
2936
                  this_dir=None, backup_files=False,
2933
2937
                  merge_type=None,
2934
2938
                  file_list=None, show_base=False, reprocess=False,
 
2939
                  pull=False,
2935
2940
                  pb=DummyProgress()):
2936
2941
    """Merge changes into a tree.
2937
2942
 
2986
2991
        if merger.base_rev_id == merger.other_rev_id:
2987
2992
            note('Nothing to do.')
2988
2993
            return 0
 
2994
        if file_list is None:
 
2995
            if pull and merger.base_rev_id == merger.this_rev_id:
 
2996
                count = merger.this_tree.pull(merger.this_branch,
 
2997
                        False, merger.other_rev_id)
 
2998
                note('%d revision(s) pulled.' % (count,))
 
2999
                return 0
2989
3000
        merger.backup_files = backup_files
2990
3001
        merger.merge_type = merge_type 
2991
3002
        merger.set_interesting_files(file_list)