From 5294d9dc3598785078ed4eca33e663f639da2a4b Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Thu, 29 Aug 2013 23:43:25 +0100 Subject: [PATCH] Fix importing of inline data Import of inline data was failing because the temporary file containing the inline data was written to .../.rs/inline- but was being accessed from the current working directory .../temp-import- using just the file name without a path. Save the full path to the inline data file, rather than just the file name. Test case: $ cat test-01-inline-data.fastexp commit refs/heads/master mark :1 committer Joe Bloggs 998655365 +0100 data 13 Add file.txt M 644 inline file.txt data 21 Contents of file.txt $ rcs-fast-import -v -v -v < test-01-inline-data.fastexp rcs-fast-import: repository fast import creates /tmp/test/.rs16719 rcs-fast-import:......(0.00 sec) done. commit refs/heads/master rcs-fast-import: :1 M file.txt rcs-fast-import: linking inline-164709420 to file.txt cleaning up......(0.00 sec) done. rcs-fast-import: cleaning up /tmp/test/.rs16719......(0.00 sec) done. rcs-fast-import: refusing to step on file.txt: OSError(2, 'No such file or directory'). --- rcs-fast-import | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcs-fast-import b/rcs-fast-import index 7f95f85..36272a6 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -441,8 +441,8 @@ class Repository: else: self.error("no blob matches commit reference to %s" % fileop.ref) elif fileop.ref == 'inline': - fileop.copyname = "inline-" + `id(commit)` - read_data(open(os.path.join(self.subdir(), fileop.copyname), "w")).close() + fileop.copyname = os.path.join(self.subdir(), "inline-" + `id(commit)`) + read_data(open(fileop.copyname, "w")).close() else: self.error("unknown content type in filemodify") # Handling of file ops ends. -- 2.43.0