# HG changeset patch # User Patrick Mezard # Date 2009-04-11 21:43:24 # Node ID fe2a87a3d344878982641110dd26f2949a0b6fff # Parent 718c8f01feb2813c6864987aa0e1bbe1228ac9a5 convert/mtn: allow monotone database files as sources diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -16,7 +16,13 @@ class monotone_source(converter_source, norepo = NoRepo (_("%s does not look like a monotone repo") % path) if not os.path.exists(os.path.join(path, '_MTN')): - raise norepo + # Could be a monotone repository (SQLite db file) + try: + header = file(path, 'rb').read(16) + except: + header = '' + if header != 'SQLite format 3\x00': + raise norepo # regular expressions for parsing monotone output space = r'\s*'