From 1c8bbc40aeb984a65495b2e7be9466cd79718a72 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 10 May 2012 17:21:13 -0400 Subject: [PATCH] move default subversion aliases out of the user default configuration and apply them after applying user aliases --- jsvn | 69 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/jsvn b/jsvn index 1a04518..e4ae3b3 100755 --- a/jsvn +++ b/jsvn @@ -64,38 +64,6 @@ def get_config(svn): 'use_pager': True, 'use_color': True, 'aliases': { - # default Subversion aliases - 'praise': 'blame', - 'annotate': 'blame', - 'ann': 'blame', - 'cl': 'changelist', - 'co': 'checkout', - 'ci': 'commit', - 'cp': 'copy', - 'del': 'delete', - 'remove': 'delete', - 'rm': 'delete', - 'di': 'diff', - '?': 'help', - 'h': 'help', - 'ls': 'list', - 'mv': 'move', - 'rename': 'move', - 'ren': 'move', - 'pdel': 'propdel', - 'pd': 'propdel', - 'pedit': 'propedit', - 'pe': 'propedit', - 'pget': 'propget', - 'pg': 'propget', - 'plist': 'proplist', - 'pl': 'proplist', - 'pset': 'propset', - 'ps': 'propset', - 'stat': 'status', - 'st': 'status', - 'sw': 'switch', - 'up': 'update', # default jsvn aliases 'tags': 'tag', 'branches': 'branch'}, @@ -1055,6 +1023,43 @@ def do_cmd(argv, realsvn, config, expand=True): Popen(argv, shell=True).wait() return + # after processing user aliases, apply default Subversion aliases + svn_aliases = { + 'praise': 'blame', + 'annotate': 'blame', + 'ann': 'blame', + 'cl': 'changelist', + 'co': 'checkout', + 'ci': 'commit', + 'cp': 'copy', + 'del': 'delete', + 'remove': 'delete', + 'rm': 'delete', + 'di': 'diff', + '?': 'help', + 'h': 'help', + 'ls': 'list', + 'mv': 'move', + 'rename': 'move', + 'ren': 'move', + 'pdel': 'propdel', + 'pd': 'propdel', + 'pedit': 'propedit', + 'pe': 'propedit', + 'pget': 'propget', + 'pg': 'propget', + 'plist': 'proplist', + 'pl': 'proplist', + 'pset': 'propset', + 'ps': 'propset', + 'stat': 'status', + 'st': 'status', + 'sw': 'switch', + 'up': 'update', + } + if argv[0] in svn_aliases: + argv[0] = svn_aliases[argv[0]] + out = sys.stdout using_pager = False using_color = sys.stdout.isatty() and config['use_color']