diff tests/test_util.py @ 890:78db88de9622

Partial metadata rebuilding For highly active subversion repositories, it can be excruciatingly slow to pull updates one at a time from subversion. One way around this is to setup another mercurial repo that pulls new commits from svn periodicly (say every 5 minutes). When you want to update your repository, you can pull commits from this mercurial repository via native mercurial protocols, which will be much faster than pulling directly from svn. Unfortunately, your metadata will be out of date after doing so. Highly active repositories also tend to be very large, which means that it takes a long time to rebuild your metadata from scratch. To address this, this adds support to do a partial rebuild on the metadata by processing only revisions that have been added to the repository after the last revision we processed. With the rev map 1k revisions (~2 days) behind tip updatemeta is dramatically faster than rebuild meta: $ hg --time svn updatemeta Time: real 0.570 secs (user 0.480+0.000 sys 0.060+0.000) $ hg --time svn rebuildmeta Time: real 129.160 secs (user 128.570+0.000 sys 0.320+0.000)
author David Schleimer <dschleimer@fb.com>
date Sat, 12 May 2012 07:28:23 -0700
parents c6388ed0ec0a
children 04dfc23688b9
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -199,12 +199,12 @@ def _verify_our_modules():
             'from the wrong path!'
         )
 
-def hgclone(ui, source, dest, update=True):
+def hgclone(ui, source, dest, update=True, rev=None):
     if getattr(hg, 'peer', None):
         # Since 1.9 (d976542986d2)
-        src, dest = hg.clone(ui, {}, source, dest, update=update)
+        src, dest = hg.clone(ui, {}, source, dest, update=update, rev=rev)
     else:
-        src, dest = hg.clone(ui, source, dest, update=update)
+        src, dest = hg.clone(ui, source, dest, update=update, rev=rev)
     return src, dest
 
 def svnls(repo_path, path, rev='HEAD'):