[Frugalware-darcs] vmexam: dg: remove comment about why dg rec is different from dr rec

VMiklos vmiklos at frugalware.org
Wed Jun 13 21:17:34 CEST 2007


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

[dg: remove comment about why dg rec is different from dr rec
VMiklos <vmiklos at frugalware.org>**20070613191531
 it's no longer different :)
] {
hunk ./python/dg.py 9
+		self.new = False
hunk ./python/dg.py 79
+			if i == "--- /dev/null\n":
+				file.new = True
hunk ./python/dg.py 157
-It differs one way from darcs record:
-  If you did "darcs-git add new_file" and modified existing_file, then you have
-  to either:
-  - use darcs-git record existing_file or
-  - using darcs-git record, new_file will be always added
-
-  There is no easy way to exclude such a new_file, so the best is not to add it
-  till you don't want to commit it.
-
hunk ./python/dg.py 217
+	# a list for new files. we'll revert their addition, commit and add
+	# them again
+	newlist = []
+	for i in status.hunks:
+		if not i.picked:
+			lines = i.text.split("\n")
+			if "--- /dev/null" in lines:
+				newlist.append(re.sub(r".* a/([^ ]+) .*", r"\1", lines[0]))
+	for i in newlist:
+		os.system("git reset HEAD %s" % i)
hunk ./python/dg.py 228
+	# readd the uncommitted new files
+	for i in newlist:
+		os.system("git add %s" % i)
}


More information about the Frugalware-darcs mailing list