Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=c29d71586d8a1624e925ef414991c055c2caaba9
commit c29d71586d8a1624e925ef414991c055c2caaba9
Author: VMiklos <[EMAIL PROTECTED]>
Date: Tue Sep 11 20:32:31 2007 +0200
dg: binary files - part 2
handle the case when not all of the new files are picked
diff --git a/darcs-git.py b/darcs-git.py
index c2a1c71..f0939fb 100755
--- a/darcs-git.py
+++ b/darcs-git.py
@@ -124,7 +124,7 @@ def scan_dir(files=""):
file = File()
inheader = True
header.append(i)
- elif i.startswith("+++"):
+ elif i.startswith("+++") or i.startswith("index "):
header.append(i)
elif i.startswith("---"):
header.append(i)
@@ -318,11 +318,21 @@ Options:
for i in allstatus.hunks:
if not status.ispicked(i):
lines = i.text.split("\n")
- if "--- /dev/null" in lines:
+ new = False
+ for j in lines:
+ if j.startswith("index 0000000"):
+ new = True
+ break
+ if new:
newlist.append(diff2filename(lines[0]))
else:
lines = i.text.split("\n")
- if "--- /dev/null" in lines:
+ new = False
+ for j in lines:
+ if j.startswith("index 0000000"):
+ new = True
+ break
+ if new:
# this is a newly added file but maybe it has
# been updated since add. add it again
os.system("git add %s" % diff2filename(lines[0]))
@@ -420,7 +430,12 @@ Options:
# we need git reset too if we revert deleted files
for i in status.hunks:
lines = i.text.split("\n")
- if "+++ /dev/null" in lines:
+ new = False
+ for j in lines:
+ if j.startswith("index 0000000"):
+ new = True
+ break
+ if new:
os.system("git reset HEAD %s >/dev/null" % diff2filename(lines[0]))
revert_stale()
print "Finished reverting."
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git