[darcs-users] git -> darcs-fast-import is sad about directory creation
Trent W. Buck
trentbuck at gmail.com
Thu Apr 2 08:08:19 UTC 2009
"Trent W. Buck" <trentbuck at gmail.com> writes:
> I'm trying to convert an existing etckeeper (/etc) git repository to
> darcs using your darcs-fast-import. It tells me:
>
> $ ( cd ../etc && git fast-export --all ) | ../darcs-fast-export/darcs-fast-import
> Traceback (most recent call last):
> File "../darcs-fast-export/darcs-fast-import", line 295, in <module>
> h.handle()
> File "../darcs-fast-export/darcs-fast-import", line 277, in handle
> self.handle_commit()
> File "../darcs-fast-export/darcs-fast-import", line 182, in handle_commit
> sock = open(path, "w")
> IOError: [Errno 2] No such file or directory: 'Muttrc.d/charset.rc'
I got further on my own with the following patch.
diff --git a/darcs-fast-import b/darcs-fast-import
index 1e6c893..f7a45fc 100755
--- a/darcs-fast-import
+++ b/darcs-fast-import
@@ -179,6 +179,9 @@ class Handler:
elif self.line.startswith("M "):
items = self.line.split(' ')
path = items[3][:-1]
+ print "I'm an 'M '! " + path
+ if os.path.dirname (path) and not os.path.exists (os.path.dirname (path)):
+ os.makedirs (os.path.dirname (path))
sock = open(path, "w")
if items[2] != "inline":
idx = int(items[2][1:])
However I know run into a problem I can't understand. It seems to be
related to this incremental marking business. I'm not interested in
increments, because this is a one-off conversion.
$ rm -rf etc-darcs
$ darcs init --repo etc-darcs
$ (cd etc-darcs && ../darcs-fast-import) <etc-git.fast-export
[...]
I'm an 'M '! acpi/battery.d/90-hdparm.sh
Traceback (most recent call last):
File "../darcs-fast-import", line 298, in <module>
h.handle()
File "../darcs-fast-import", line 280, in handle
self.handle_commit()
File "../darcs-fast-import", line 188, in handle_commit
sock.write(self.marks[idx])
KeyError: 25
I tried to get git fast-export to export marks, but as usual its error
reporting is completely unintelligible:
$ sudo git fast-export --export-marks /tmp/etc.marks --all >/tmp/etc.git
fatal: ambiguous argument '/tmp/etc.marks': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions
More information about the darcs-users
mailing list