speed up relink script

TK Soh teekaysoh at gmail.com
Mon Mar 19 19:15:40 UTC 2007


I was trying out the relink script recently added to crew repo. While
it works, it seemed a bit slow running on those hugh repos I have
(some of the .hg/ are coming close to 1GB). So I tried the following
patch to speed things up a little. See if anyone find it useful, or
probably spot any problem with it.

diff -r 7663780b55a7 contrib/hg-relink
--- a/contrib/hg-relink Mon Mar 19 09:36:06 2007 -0700
+++ b/contrib/hg-relink Mon Mar 19 14:05:49 2007 -0500
@@ -72,6 +72,8 @@ def relink(src, dst, files):
         tgt = os.path.join(dst, f)
         sfp = file(source)
         dfp = file(tgt)
+        sfp.seek(CHUNKLEN, 2)
+        dfp.seek(CHUNKLEN, 2)
         sin = sfp.read(CHUNKLEN)
         while sin:
             din = dfp.read(CHUNKLEN)



More information about the Mercurial mailing list