~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2006-12-21 03:59:43 UTC
  • mfrom: (2206 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2207.
  • Revision ID: mbp@sourcefrog.net-20061221035943-2qazd36lrxms0bug
merge bzr.dev, reconcile with option changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1217
1217
    takes_args = ['file*']
1218
1218
    takes_options = ['revision', 'diff-options',
1219
1219
        Option('prefix', type=str,
 
1220
               short_name='p',
1220
1221
               help='Set prefixes to added to old and new filenames, as '
1221
1222
                    'two values separated by a colon.'),
1222
1223
        ]
1377
1378
                            help='show from oldest to newest'),
1378
1379
                     'timezone', 
1379
1380
                     Option('verbose', 
 
1381
                             short_name='v',
1380
1382
                             help='show files changed in each revision'),
1381
1383
                     'show-ids', 'revision',
1382
1384
                     'log-format',
1383
1385
                     'line', 'long', 
1384
1386
                     Option('message',
 
1387
                            short_name='m',
1385
1388
                            help='show revisions whose message matches this regexp',
1386
1389
                            type=str),
1387
1390
                     'short',
1752
1755
 
1753
1756
    takes_options = ['revision', 'name-from-revision']
1754
1757
    takes_args = ['filename']
 
1758
    encoding_type = 'exact'
1755
1759
 
1756
1760
    @display_command
1757
1761
    def run(self, filename, revision=None, name_from_revision=False):
1831
1835
                     Option('unchanged',
1832
1836
                            help='commit even if nothing has changed'),
1833
1837
                     Option('file', type=str, 
 
1838
                            short_name='F',
1834
1839
                            argname='msgfile',
1835
1840
                            help='file containing commit message'),
1836
1841
                     Option('strict',
2112
2117
            if verbose is None:
2113
2118
                verbose = True
2114
2119
            # TODO: should possibly lock the history file...
2115
 
            benchfile = open(".perf_history", "at")
 
2120
            benchfile = open(".perf_history", "at", buffering=1)
2116
2121
        else:
2117
2122
            test_suite_factory = None
2118
2123
            if verbose is None:
2228
2233
    takes_args = ['branch?']
2229
2234
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2230
2235
                     Option('show-base', help="Show base revision text in "
2231
 
                            "conflicts"), 
 
2236
                            "conflicts"),
2232
2237
                     Option('uncommitted', help='Apply uncommitted changes'
2233
 
                            ' from a working copy, instead of branch changes')]
 
2238
                            ' from a working copy, instead of branch changes'),
 
2239
                     Option('pull', help='If the destination is already'
 
2240
                             ' completely merged into the source, pull from the'
 
2241
                             ' source rather than merging. When this happens,'
 
2242
                             ' you do not need to commit the result.'),
 
2243
                     ]
2234
2244
 
2235
2245
    def help(self):
2236
2246
        from inspect import getdoc
2238
2248
 
2239
2249
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2240
2250
            show_base=False, reprocess=False, remember=False, 
2241
 
            uncommitted=False):
 
2251
            uncommitted=False, pull=False):
2242
2252
        if merge_type is None:
2243
2253
            merge_type = _mod_merge.Merge3Merger
2244
2254
 
2309
2319
                    merge_type=merge_type,
2310
2320
                    reprocess=reprocess,
2311
2321
                    show_base=show_base,
 
2322
                    pull=pull,
2312
2323
                    pb=pb, file_list=interesting_files)
2313
2324
            finally:
2314
2325
                pb.finished()
2968
2979
                  this_dir=None, backup_files=False,
2969
2980
                  merge_type=None,
2970
2981
                  file_list=None, show_base=False, reprocess=False,
 
2982
                  pull=False,
2971
2983
                  pb=DummyProgress()):
2972
2984
    """Merge changes into a tree.
2973
2985
 
3022
3034
        if merger.base_rev_id == merger.other_rev_id:
3023
3035
            note('Nothing to do.')
3024
3036
            return 0
 
3037
        if file_list is None:
 
3038
            if pull and merger.base_rev_id == merger.this_rev_id:
 
3039
                count = merger.this_tree.pull(merger.this_branch,
 
3040
                        False, merger.other_rev_id)
 
3041
                note('%d revision(s) pulled.' % (count,))
 
3042
                return 0
3025
3043
        merger.backup_files = backup_files
3026
3044
        merger.merge_type = merge_type 
3027
3045
        merger.set_interesting_files(file_list)