[PATCH] adding option aliases to 'bzr missing'
Elliot Murphy
elliot at canonical.com
Wed Jun 6 16:51:14 BST 2007
Hi!
This patch adds --local and --remote options to the bzr missing command. The options are simply aliases for the existing --mine-only and --theirs-only options. I find these aliases much easier to remember and type - plus I'm not quite smart enough to spell 'theirs' correctly without checking the help every time.
There is something I don't like about the patch - you'll notice that the remote option is spelled with an extra 'e'. This is because when I spelled it as 'remote', it did not show up in the output from 'bzr help missing'. I suspect some kind of weird namespace problem, but wasn't able to figure it out. During usage, spelling it --remote works fine because bzr is still able to match to the right option.
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2007-05-25 04:00:47 +0000
+++ bzrlib/builtins.py 2007-06-06 15:44:11 +0000
@@ -2972,8 +2972,10 @@
takes_options = [Option('reverse', 'Reverse the order of revisions'),
Option('mine-only',
'Display changes in the local branch only'),
+ Option('local' , 'same as --mine-only'),
Option('theirs-only',
- 'Display changes in the remote branch only'),
+ 'Display changes in the remote branch only'),
+ Option('remotee', 'same as --theirs-only'),
'log-format',
'show-ids',
'verbose'
@@ -2983,9 +2985,15 @@
@display_command
def run(self, other_branch=None, reverse=False, mine_only=False,
theirs_only=False, log_format=None, long=False, short=False, line=False,
- show_ids=False, verbose=False):
+ show_ids=False, verbose=False, local=False, remotee=False):
from bzrlib.missing import find_unmerged, iter_log_revisions
from bzrlib.log import log_formatter
+
+ if local:
+ mine_only = local
+ if remotee:
+ theirs_only = remotee
+
local_branch = Branch.open_containing(u".")[0]
parent = local_branch.get_parent()
if other_branch is None:
--
Elliot Murphy | https://launchpad.net/~emurphy/
More information about the bazaar
mailing list