~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2012-04-16 11:35:53 UTC
  • mfrom: (6159.2.8 overwrite-tags)
  • Revision ID: pqm@pqm.ubuntu.com-20120416113553-1vnossk7c384rp4q
(jelmer) Add --overwrite-tags option to push and pull. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1153
1153
                 "the master branch."
1154
1154
            ),
1155
1155
        Option('show-base',
1156
 
            help="Show base revision text in conflicts.")
 
1156
            help="Show base revision text in conflicts."),
 
1157
        Option('overwrite-tags',
 
1158
            help="Overwrite tags only."),
1157
1159
        ]
1158
1160
    takes_args = ['location?']
1159
1161
    encoding_type = 'replace'
1161
1163
    def run(self, location=None, remember=None, overwrite=False,
1162
1164
            revision=None, verbose=False,
1163
1165
            directory=None, local=False,
1164
 
            show_base=False):
 
1166
            show_base=False, overwrite_tags=False):
 
1167
 
 
1168
        if overwrite:
 
1169
            overwrite = ["history", "tags"]
 
1170
        elif overwrite_tags:
 
1171
            overwrite = ["tags"]
 
1172
        else:
 
1173
            overwrite = []
1165
1174
        # FIXME: too much stuff is in the command class
1166
1175
        revision_id = None
1167
1176
        mergeable = None
1305
1314
        Option('no-tree',
1306
1315
               help="Don't populate the working tree, even for protocols"
1307
1316
               " that support it."),
 
1317
        Option('overwrite-tags',
 
1318
              help="Overwrite tags only."),
1308
1319
        ]
1309
1320
    takes_args = ['location?']
1310
1321
    encoding_type = 'replace'
1312
1323
    def run(self, location=None, remember=None, overwrite=False,
1313
1324
        create_prefix=False, verbose=False, revision=None,
1314
1325
        use_existing_dir=False, directory=None, stacked_on=None,
1315
 
        stacked=False, strict=None, no_tree=False):
 
1326
        stacked=False, strict=None, no_tree=False,
 
1327
        overwrite_tags=False):
1316
1328
        from bzrlib.push import _show_push_branch
1317
1329
 
 
1330
        if overwrite:
 
1331
            overwrite = ["history", "tags"]
 
1332
        elif overwrite_tags:
 
1333
            overwrite = ["tags"]
 
1334
        else:
 
1335
            overwrite = []
 
1336
 
1318
1337
        if directory is None:
1319
1338
            directory = '.'
1320
1339
        # Get the source branch