# 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 --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -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 @@ class changelog(revlog): 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()