From 14f0e8d1f130c8d8aef8fc609e1a1a79b5058d24 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 4 Jul 2008 13:44:46 -0400 Subject: [PATCH] Implement show and cherry-pick --- README | 3 --- yap/yap.py | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README b/README index e3ffdcb..ea27cbe 100644 --- a/README +++ b/README @@ -14,15 +14,12 @@ TODO: * Commands - * show * push * fetch * merge * resolved * remote (list/create) * -d to remove - * cherry-pick - * -r to apply the opposite * Better commit template message * Fixups for running outside root? * Handle unmerged files in status diff --git a/yap/yap.py b/yap/yap.py index e6b2f09..fbf6e23 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -495,9 +495,21 @@ To skip the problematic patch, run \"yap history skip\".""" os.unlink(tmpfile) self.cmd_status() + def cmd_show(self, commit="HEAD"): + "[commit]" + os.system("git show '%s'" % commit) + + @takes_options("r") + def cmd_cherry_pick(self, commit, **flags): + "[-r] " + if '-r' in flags: + os.system("git revert '%s'" % commit) + else: + os.system("git cherry-pick '%s'" % commit) + def cmd_usage(self): print >> sys.stderr, "usage: %s " % sys.argv[0] - print >> sys.stderr, " valid commands: init add rm stage unstage status revert commit uncommit log diff branch switch point history version" + print >> sys.stderr, " valid commands: init add rm stage unstage status revert commit uncommit log show diff branch switch point cherry-pick history version" def main(self, args): if len(args) < 1: @@ -510,6 +522,7 @@ To skip the problematic patch, run \"yap history skip\".""" debug = os.getenv('YAP_DEBUG') try: + command = command.replace('-', '_') meth = self.__getattribute__("cmd_"+command) try: if "options" in meth.__dict__: -- 2.11.4.GIT