Part of bzrlib.builtins View In Hierarchy
Method | run | Actually run the command. |
Method | sanity_check_merger | Undocumented |
Method | get_merger_from_uncommitted | Get a merger for uncommitted changes. |
Method | _get_preview | Undocumented |
Method | _do_preview | Undocumented |
Method | _do_merge | Undocumented |
Method | _do_interactive | Perform an interactive merge. |
Method | _get_merger_from_branch | Produce a merger from a location, assuming it refers to a branch. |
Method | _select_branch_location | Select a branch location, according to possible inputs. |
Method | _get_remembered | Use tree.branch's parent if none was supplied. |
Inherited from Command:
Method | __init__ | Construct an instance of this command. |
Method | add_cleanup | Register a function to call after self.run returns or raises. |
Method | cleanup_now | Execute and empty pending cleanup functions immediately. |
Method | get_help_text | Return a text string with help for this command. |
Method | get_help_topic | Return the commands help topic - its name. |
Method | get_see_also | Return a list of help topics that are related to this command. |
Method | options | Return dict of valid options for this command. |
Method | run_argv_aliases | Parse the command line and run with extra aliases in alias_argv. |
Method | help | Return help message for this class. |
Method | gettext | Returns the gettext function used to translate this command's help. |
Method | name | Return the canonical name for this command. |
Method | plugin_name | Get the name of the plugin that provides this command. |
Method | _usage | Return single-line grammar for this command. |
Static Method | _get_help_parts | Split help text into a summary and named sections. |
Method | _setup_outf | Return a file linked to stdout, which has proper encoding. |
Method | _setup_run | Wrap the defined run method on self with a cleanup. |
Actually run the command.
This is invoked with the options and arguments bound to keyword parameters.
Return 0 or None if the command was successful, or a non-zero shell error code if not. It's OK for this method to allow an exception to raise up.
This method is automatically wrapped by Command.__init__ with a cleanup operation, stored as self._operation. This can be used via self.add_cleanup to perform automatic cleanups at the end of run().
The argument for run are assembled by introspection. So for instance, if your command takes an argument files, you would declare:
def run(self, files=None): pass
This works by generating a preview tree of the merge, then using Shelver to selectively remove the differences between the working tree and the preview tree.
Parameters | tree | The tree the merger should apply to. |
location | The location containing uncommitted changes. | |
pb | The progress bar to use for showing progress. |
If provided, branches from revision are preferred. (Both revision and index must be supplied.)
Otherwise, the location parameter is used. If it is None, then the submit or parent location is used, and a note is printed.
Parameters | tree | The working tree to select a branch for merging into |
location | The location entered by the user | |
revision | The revision parameter to the command | |
index | The index to use for the revision parameter. Negative indices are permitted. | |
Returns | (selected_location, user_location). The default location will be the user-entered location. |