summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2010-06-27 17:59:55 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2010-06-27 17:59:55 +0200
commitb3ce87bb2a686428817f0575db509a80bb720217 (patch)
tree01eab421bc24a7aebc6f2eb1863f98e987a3ffa1
parent8b1d84c04a11d6a1a27898af77340ec5ab234217 (diff)
downloadpython-fastimport-b3ce87bb2a686428817f0575db509a80bb720217.tar.gz
darcs-fast-import: No longer throw away the blob after writing it
It turns out that a mark can be used multiple times, and given that reading it from darcs may be slow, let's just keep it in the memory for now. Later - if it turns out the memory usage is too heavy - we can still use darcs show contents instead.
-rwxr-xr-xexporters/darcs/darcs-fast-import1
-rw-r--r--exporters/darcs/t/lib.sh5
2 files changed, 5 insertions, 1 deletions
diff --git a/exporters/darcs/darcs-fast-import b/exporters/darcs/darcs-fast-import
index 0a1495d..4892438 100755
--- a/exporters/darcs/darcs-fast-import
+++ b/exporters/darcs/darcs-fast-import
@@ -206,7 +206,6 @@ class Handler:
if items[2] != "inline":
idx = int(items[2][1:])
sock.write(self.marks[idx])
- del self.marks[idx]
else:
self.read_next_line()
self.handle_data()
diff --git a/exporters/darcs/t/lib.sh b/exporters/darcs/t/lib.sh
index dcdc0f8..87c4db9 100644
--- a/exporters/darcs/t/lib.sh
+++ b/exporters/darcs/t/lib.sh
@@ -224,6 +224,11 @@ third line" | git commit -a -F -
git commit -a -m "add empty file"
rm file3
git commit -a -m "remove file"
+ # now add back 'file' with its old conents, so the mark gets
+ # reused
+ echo f > file
+ git add file
+ git commit -a -m "file: other -> f"
cd ..
}