[Frugalware-darcs] vmexam: dg: handle the case in record() if we're creating the initial commit

VMiklos vmiklos at frugalware.org
Fri Jun 15 19:57:24 CEST 2007


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

[dg: handle the case in record() if we're creating the initial commit
VMiklos <vmiklos at frugalware.org>**20070615175504] {
hunk ./python/dg.py 231
-	# we need the overall status too, to exclude new files if necessary
-	allstatus = scan_dir()
-	status = scan_dir(options.files)
-	if not options.all:
-		status.hunks = askhunks(status.hunks)
-	if status.hunks:
+	root = get_root()
+	first = False
+	if emptydir(os.path.join(root, "refs", "heads")):
+		first = True
+		print "This is a new repo, can't cherry-pick for the first commit."
+	if first:
+		status = Files([])
+	else:
+		# we need the overall status too, to exclude new files if necessary
+		allstatus = scan_dir()
+		status = scan_dir(options.files)
+		if not options.all:
+			status.hunks = askhunks(status.hunks)
+	if first or status.hunks:
hunk ./python/dg.py 265
-	if options.all:
+	if first or options.all:
}


More information about the Frugalware-darcs mailing list