[Frugalware-darcs] vmexam: dg: handle the case when one would like to record in an empty repo

VMiklos vmiklos at frugalware.org
Wed Jun 20 01:05:00 CEST 2007


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

[dg: handle the case when one would like to record in an empty repo
VMiklos <vmiklos at frugalware.org>**20070619230107] {
hunk ./python/dg.py 235
-		print "This is a new repo, can't cherry-pick for the first commit."
+		sock = os.popen("git status")
+		lines = sock.readlines()
+		sock.close()
+		changes = True
+		for i in lines:
+			if i.startswith("nothing"):
+				changes = False
+		if changes:
+			print "This is a new repo, can't cherry-pick for the first commit."
+		else:
+			print "No changes!"
+			sys.exit(0)
}


More information about the Frugalware-darcs mailing list