[Frugalware-darcs] vmexam: dg: bugfix for record()

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=20070614162747-e2957-a9a8d09063b9c2138e448b4376d6c0f060843a06.gz;

[dg: bugfix for record()
VMiklos <vmiklos at frugalware.org>**20070614162747
 handle the following case:
 dg add foo.c bar.c
 dg rec foo.c
 in this case we recorded bar.c too (since we filtered for foo.c and this way
 missed to exclude bar.c)
] {
hunk ./python/dg.py 23
+	def ispicked(self, hunk):
+		needle = diff2filename(hunk.text.split("\n")[0])
+		for i in self.hunks:
+			if needle == diff2filename(i.text.split("\n")[0]):
+				return i.picked
hunk ./python/dg.py 214
+	# we need the overall status too, to exclude new files if necessary
+	allstatus = scan_dir()
hunk ./python/dg.py 253
-	for i in status.hunks:
-		if not i.picked:
+	for i in allstatus.hunks:
+		if not status.ispicked(i):
}


More information about the Frugalware-darcs mailing list