convert/gnuarch: robustify cat-log retrieval
authorEdouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7580 8c5afb3cdb67
parent 7579 a8db971dc258
child 7581 3742981341c1
convert/gnuarch: robustify cat-log retrieval GNU Arch used to scale very poorly when revision number was increasing. This was mostly caused by the huge amount of cat-log it has to scan/read through to keep track of all patches that were merged in a given revision. In order to improve things, cat-log prunning was a common admin task that would accelerate cat-log parsing at the expense of unreachabe locally stored cat-logs. However, these missing cat-logs are still available in the archive. So try to get them from the archive as a fallback solution.
hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py	Sun Jan 04 02:36:48 2009 +0100
+++ b/hgext/convert/gnuarch.py	Sun Jan 04 02:36:48 2009 +0100
@@ -73,7 +73,9 @@
             self.changes[rev] = self.gnuarch_rev(rev)
 
             # Read author, date and summary
-            catlog = self.run0('cat-log', '-d', self.path, rev)
+            catlog, status = self.run('cat-log', '-d', self.path, rev)
+            if status:
+                catlog = self.run0('cat-archive-log', rev)
             self._parsecatlog(catlog, rev)
 
             self.parents[rev] = child