[Frugalware-darcs] vmexam: dg: record(): fix for -e, new switch -s

VMiklos vmiklos at frugalware.org
Thu Jun 14 19:58:06 CEST 2007


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

[dg: record(): fix for -e, new switch -s
VMiklos <vmiklos at frugalware.org>**20070614160446] {
hunk ./python/dg.py 174
+  -s            --skip-long-comment      Don't give a long comment
hunk ./python/dg.py 182
+			self.edit = None
hunk ./python/dg.py 188
-		opts, args = getopt.getopt(argv, "m:ah", ["commit-name=", "all", "help"])
+		opts, args = getopt.getopt(argv, "m:aesh", ["commit-name=", "all", "edit-long-comment", "skip-long-comment", "help"])
hunk ./python/dg.py 196
+		elif opt in ("-e", "--edit-long-comment"):
+			options.edit = "-e"
+		elif opt in ("-s", "--skip-long-comment"):
+			options.edit = ""
hunk ./python/dg.py 213
-		if options.name:
-			msg = options.name
-		else:
-			msg = ask("What is the patch name?", str)
+		if not options.name:
+			options.name = ask("What is the patch name?", str)
hunk ./python/dg.py 218
-	while True:
-		ret = ask("Do you want to add a long comment? [ynq]")
-		if ret == "y":
-			opts = "-e"
-			break
-		if ret == "n":
-			opts = ""
-			break
-		if ret == "q":
-			sys.exit(0)
-		print "Invalid response, try again!"
+	if options.edit is None:
+		while True:
+			ret = ask("Do you want to add a long comment? [ynq]")
+			if ret == "y":
+				options.edit = "-e"
+				break
+			if ret == "n":
+				options.edit = ""
+				break
+			if ret == "q":
+				sys.exit(0)
+			print "Invalid response, try again!"
hunk ./python/dg.py 234
-		os.system("git commit -a -m '%s' %s %s" % (msg, opts, options.files))
+		os.system("git commit -a -m '%s' %s %s" % (options.name, options.edit, options.files))
hunk ./python/dg.py 253
-	os.system("git commit -m '%s' %s" % (msg, opts))
+	os.system("git commit -m '%s' %s" % (options.name, options.edit))
}


More information about the Frugalware-darcs mailing list