[PATCH 4 of 9] convert/gnuarch: robustify cat-log retrieval

Edouard Gomez ed.gomez at free.fr
Sat Jan 3 19:37:13 CST 2009

# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1231033008 -3600
# Node ID 7b1ab55be104c9feab70692e2927c0794f16ba2b
# Parent  737ce860ff2f94a3ba5a132b5b37f55cc2c78b4e
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.

diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py
+++ b/hgext/convert/gnuarch.py
@@ -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

More information about the Mercurial-devel mailing list