~ursinha/lp-qa-tools/bzr-tarmacland

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-14 06:47:52 UTC
  • Revision ID: andrew@bemusement.org-20091014064752-28xlcdfphzli4dce
Slightly hackish way to allow submitting branches I don't have locally.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
               help='Use this url as the public location to the pqm.'),
79
79
        Option('submit-branch', type=str,
80
80
               help='Use this url as the target submission branch.'),
 
81
        Option('ignore-local', help='Do not check the local branch or tree.'),
81
82
        ]
82
83
 
83
84
    def run(self, location=None, message=None, public_location=None,
84
 
            dry_run=False, submit_branch=None):
 
85
            dry_run=False, submit_branch=None, ignore_local=False):
85
86
        from bzrlib import errors, trace, bzrdir
86
87
        if __name__ != 'bzrlib.plugins.pqm':
87
88
            trace.warning('The bzr-pqm plugin needs to be called'
91
92
            return 1
92
93
        from bzrlib.plugins.pqm.pqm_submit import submit
93
94
 
94
 
        if location is None:
95
 
            location = '.'
96
 
        tree, b, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(location)
 
95
        if ignore_local:
 
96
            tree, b, relpath = None, None, None
 
97
        else:
 
98
            if location is None:
 
99
                location = '.'
 
100
            tree, b, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(
 
101
                location)
97
102
        if relpath and not tree and location != '.':
98
103
            raise errors.BzrCommandError(
99
104
                'No working tree was found, but we were not given the '
105
110
        submit(b, message=message, dry_run=dry_run,
106
111
               public_location=public_location,
107
112
               submit_location=submit_branch,
108
 
               tree=tree)
 
113
               tree=tree, ignore_local=ignore_local)
109
114
 
110
115
 
111
116
register_command(cmd_pqm_submit)