[Frugalware-darcs] vmexam: dg: new unpull alias

VMiklos vmiklos at frugalware.org
Thu Jun 14 02:55:07 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=vmexam;a=darcs_commitdiff;h=20070614004904-e2957-21f30db55afc9cf89e2ddc8255af3b7861a31dd8.gz;

[dg: new unpull alias
VMiklos <vmiklos at frugalware.org>**20070614004904] {
hunk ./python/dg.py 459
+def unpull(argv):
+	def usage(ret):
+		print """Usage: darcs-git unpull [OPTION]...
+Opposite of pull; unsafe if the latest patch is not in remote repository.
+This is an alias for "git reset --soft HEAD^; git checkout -f".
+
+Options:
+  -h         --help                shows brief description of command and its arguments"""
+		sys.exit(ret)
+	if len(argv) and argv[0] in ("-h", "--help"):
+		usage(0)
+	while True:
+		ret = ask("Do you want to unpull the last committed patch? [ynq]")
+		if ret == "y":
+			break
+		if ret in ("n", "q"):
+			sys.exit(0)
+		print "Invalid response, try again!"
+	os.system("git reset --soft HEAD^ %s" % " ".join(argv))
+	os.system("git checkout -f %s" % " ".join(argv))
+
hunk ./python/dg.py 498
+		elif sys.argv[1] == "unpull":
+			unpull(argv[1:])
}


More information about the Frugalware-darcs mailing list