# HG changeset patch # User mpm@selenic.com # Date 1115511151 28800 # Node ID a8811676c85a29d5ff567b2509737e83e0efcf14 # Parent da28286bf6b7d602ef1cf5a7cf4b374f4cd60431 Move hex/bin bits to revlog Handle lookup of rev -1 of changelog diff -r da28286bf6b7 -r a8811676c85a mercurial/hg.py --- a/mercurial/hg.py Sat May 07 16:11:36 2005 -0800 +++ b/mercurial/hg.py Sat May 07 16:12:31 2005 -0800 @@ -5,15 +5,12 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import sys, struct, sha, socket, os, time, base64, re, urllib2, binascii +import sys, struct, sha, socket, os, time, base64, re, urllib2 import urllib from mercurial import byterange from mercurial.transaction import * from mercurial.revlog import * -def hex(node): return binascii.hexlify(node) -def bin(node): return binascii.unhexlify(node) - class filelog(revlog): def __init__(self, opener, path): s = self.encodepath(path) @@ -112,6 +109,8 @@ revlog.__init__(self, opener, "00changelog.i", "00changelog.d") def extract(self, text): + if not text: + return (nullid, "", 0, [], "") last = text.index("\n\n") desc = text[last + 2:] l = text[:last].splitlines()