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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-04 15:48:54 UTC
  • mfrom: (7131.9.2 reference-force)
  • Revision ID: breezy.the.bot@gmail.com-20181104154854-bwguskxu88kfldws
Support forcing the setting of a reference.

Useful for testing.

Merged from https://code.launchpad.net/~jelmer/brz/reference-force/+merge/355876

Show diffs side-by-side

added added

removed removed

Lines of Context:
2972
2972
            Option('ignored', short_name='i',
2973
2973
                help='Print ignored files.'),
2974
2974
            Option('kind', short_name='k',
2975
 
                   help='List entries of a particular kind: file, directory, symlink.',
 
2975
                   help=('List entries of a particular kind: file, '
 
2976
                         'directory, symlink, tree-reference.'),
2976
2977
                   type=text_type),
2977
2978
            'null',
2978
2979
            'show-ids',
6682
6683
    hidden = True
6683
6684
 
6684
6685
    takes_args = ['path?', 'location?']
 
6686
    takes_options = [
 
6687
        Option('force-unversioned',
 
6688
               help='Set reference even if path is not versioned.'),
 
6689
        ]
6685
6690
 
6686
 
    def run(self, path=None, location=None):
 
6691
    def run(self, path=None, location=None, force_unversioned=False):
6687
6692
        branchdir = '.'
6688
6693
        if path is not None:
6689
6694
            branchdir = path
6697
6702
            info = viewitems(branch._get_all_reference_info())
6698
6703
            self._display_reference_info(tree, branch, info)
6699
6704
        else:
6700
 
            if not tree.is_versioned(path):
 
6705
            if not tree.is_versioned(path) and not force_unversioned:
6701
6706
                raise errors.NotVersionedError(path)
6702
6707
            if location is None:
6703
6708
                info = [(path, branch.get_reference_info(path))]