# HG changeset patch # User Eric Hopper # Date 2005-11-19 06:48:47 # Node ID 59b3639df0a93edd313ad03d0a76bd50a78c07eb # Parent 68ec7b9e09a48d8100cf5394279060cefdda1f82 Convert all classes to new-style classes by deriving them from object. diff --git a/contrib/hbisect.py b/contrib/hbisect.py --- a/contrib/hbisect.py +++ b/contrib/hbisect.py @@ -26,7 +26,7 @@ def check_clean(ui, repo): ui.warn("Repository is not clean, please commit or revert\n") sys.exit(1) -class bisect: +class bisect(object): """dichotomic search in the DAG of changesets""" def __init__(self, ui, repo): self.repo = repo diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -678,7 +678,7 @@ def clone(ui, source, dest=None, **opts) dest = os.path.realpath(dest) - class Dircleanup: + class Dircleanup(object): def __init__(self, dir_): self.rmtree = shutil.rmtree self.dir_ = dir_ @@ -1188,7 +1188,7 @@ def grep(ui, repo, pattern, *pats, **opt yield linenum, mstart - lstart, mend - lstart, body[lstart:lend] begin = lend + 1 - class linestate: + class linestate(object): def __init__(self, line, linenum, colstart, colend): self.line = line self.linenum = linenum @@ -1479,7 +1479,7 @@ def log(ui, repo, *pats, **opts): -v switch adds some more detail, such as changed files, manifest hashes or message signatures. """ - class dui: + class dui(object): # Implement and delegate some ui protocol. Save hunks of # output for later display in the desired order. def __init__(self, ui): diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -13,7 +13,7 @@ from i18n import gettext as _ from demandload import * demandload(globals(), "time bisect stat util re errno") -class dirstate: +class dirstate(object): def __init__(self, opener, ui, root): self.opener = opener self.root = root diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -71,7 +71,7 @@ def get_mtime(repo_path): else: return os.stat(hg_path).st_mtime -class hgrequest: +class hgrequest(object): def __init__(self, inp=None, out=None, env=None): self.inp = inp or sys.stdin self.out = out or sys.stdout @@ -104,7 +104,7 @@ class hgrequest: headers.append(('Content-length', str(size))) self.header(headers) -class templater: +class templater(object): def __init__(self, mapfile, filters={}, defaults={}): self.cache = {} self.map = {} @@ -175,7 +175,7 @@ common_filters = { "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"), } -class hgweb: +class hgweb(object): def __init__(self, repo, name=None): if type(repo) == type(""): self.repo = hg.repository(ui.ui(), repo) @@ -952,7 +952,7 @@ def create_server(repo): return BaseHTTPServer.HTTPServer((address, port), hgwebhandler) # This is a stopgap -class hgwebdir: +class hgwebdir(object): def __init__(self, config): def cleannames(items): return [(name.strip('/'), path) for name, path in items] diff --git a/mercurial/httprangereader.py b/mercurial/httprangereader.py --- a/mercurial/httprangereader.py +++ b/mercurial/httprangereader.py @@ -7,7 +7,7 @@ import byterange, urllib2 -class httprangereader: +class httprangereader(object): def __init__(self, url): self.url = url self.pos = 0 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -12,7 +12,7 @@ from i18n import gettext as _ from demandload import * demandload(globals(), "re lock transaction tempfile stat mdiff errno") -class localrepository: +class localrepository(object): def __init__(self, ui, path=None, create=0): if not path: p = os.getcwd() diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -11,7 +11,7 @@ import util class LockHeld(Exception): pass -class lock: +class lock(object): def __init__(self, file, wait=1, releasefn=None): self.f = file self.held = 0 diff --git a/mercurial/remoterepo.py b/mercurial/remoterepo.py --- a/mercurial/remoterepo.py +++ b/mercurial/remoterepo.py @@ -5,11 +5,11 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -class remoterepository: +class remoterepository(object): def local(self): return False -class remotelock: +class remotelock(object): def __init__(self, repo): self.repo = repo def release(self): diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -52,7 +52,7 @@ def decompress(bin): indexformat = ">4l20s20s20s" -class lazyparser: +class lazyparser(object): """ this class avoids the need to parse the entirety of large indices @@ -94,7 +94,7 @@ class lazyparser: self.map[e[6]] = i i += 1 -class lazyindex: +class lazyindex(object): """a lazy version of the index array""" def __init__(self, parser): self.p = parser @@ -114,7 +114,7 @@ class lazyindex: def trunc(self, pos): self.p.trunc(pos) -class lazymap: +class lazymap(object): """a lazy version of the node map""" def __init__(self, parser): self.p = parser @@ -152,7 +152,7 @@ class lazymap: class RevlogError(Exception): pass -class revlog: +class revlog(object): """ the underlying revision storage object diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -14,7 +14,7 @@ import os from i18n import gettext as _ -class transaction: +class transaction(object): def __init__(self, report, opener, journal, after=None): self.journal = None diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -10,7 +10,7 @@ from i18n import gettext as _ from demandload import * demandload(globals(), "re socket sys util") -class ui: +class ui(object): def __init__(self, verbose=False, debug=False, quiet=False, interactive=True): self.overlay = {}