From 12e25e7938611c855a61c8bd0566999e1aa43dd2 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 4 Jul 2008 00:31:46 -0400 Subject: [PATCH] cmd_history: show a more useful message if am quits --- yap/yap.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/yap/yap.py b/yap/yap.py index 37443ea..e6b2f09 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -428,9 +428,21 @@ class Yap(object): def cmd_history(self, subcmd, *args): "amend | drop " - if subcmd not in ("amend", "drop"): + if subcmd not in ("amend", "drop", "continue", "skip"): raise TypeError + resolvemsg = """ +When you have resolved the conflicts run \"yap history continue\". +To skip the problematic patch, run \"yap history skip\".""" + + if subcmd == "continue": + os.system("git am -r --resolvemsg='%s'" % resolvemsg) + return + if subcmd == "skip": + os.system("git reset --hard") + os.system("git am --skip --resolvemsg='%s'" % resolvemsg) + return + if subcmd == "amend": flags, args = getopt.getopt(args, "ad") flags = dict(flags) @@ -473,7 +485,7 @@ class Yap(object): stat = os.stat(tmpfile) size = stat[6] if size > 0: - rc = os.system("git am -3 '%s' > /dev/null" % tmpfile) + rc = os.system("git am -3 --resolvemsg=\'%s\' %s" % (resolvemsg, tmpfile)) if (rc): raise YapError("Failed to apply changes") -- 2.11.4.GIT