##// END OF EJS Templates
use new style classes
Benoit Boissinot -
r8778:c5f36402 default
parent child Browse files
Show More
@@ -14,7 +14,7 b' from email.Parser import Parser'
14 14
15 15 class gnuarch_source(converter_source, commandline):
16 16
17 class gnuarch_rev:
17 class gnuarch_rev(object):
18 18 def __init__(self, rev):
19 19 self.rev = rev
20 20 self.summary = ''
@@ -118,7 +118,7 b' def debugsvnlog(ui, **opts):'
118 118 args = decodeargs(sys.stdin.read())
119 119 get_log_child(sys.stdout, *args)
120 120
121 class logstream:
121 class logstream(object):
122 122 """Interruptible revision log iterator."""
123 123 def __init__(self, stdout):
124 124 self._stdout = stdout
@@ -97,7 +97,7 b' class SvnRaTransport(object):'
97 97 self.ra = ra
98 98 svn.ra.reparent(self.ra, self.svn_url.encode('utf8'))
99 99
100 class Reporter:
100 class Reporter(object):
101 101 def __init__(self, (reporter, report_baton)):
102 102 self._reporter = reporter
103 103 self._baton = report_baton
@@ -10,7 +10,7 b' from mercurial import util, commands, ma'
10 10 from mercurial import node as hgnode
11 11 from mercurial.i18n import _
12 12
13 class gpg:
13 class gpg(object):
14 14 def __init__(self, path, key=None):
15 15 self.path = path
16 16 self.key = (key and " --local-user \"%s\"" % key) or ""
@@ -99,7 +99,7 b' class ciamsg(object):'
99 99 return '\n'.join(msg)
100 100
101 101 def diffstat(self):
102 class patchbuf:
102 class patchbuf(object):
103 103 def __init__(self):
104 104 self.lines = []
105 105 # diffstat is stupid
@@ -23,7 +23,7 b' def serve(ui, repo, **opts):'
23 23 if timeout:
24 24 timeout = float(timeout) * 1e3
25 25
26 class service:
26 class service(object):
27 27 def init(self):
28 28 try:
29 29 self.master = server.master(ui, repo, timeout)
@@ -42,7 +42,7 b' commands.norepo += " qclone"'
42 42 # They must be joinable with queue directory and result in the patch path.
43 43 normname = util.normpath
44 44
45 class statusentry:
45 class statusentry(object):
46 46 def __init__(self, rev, name=None):
47 47 if not name:
48 48 fields = rev.split(':', 1)
@@ -191,7 +191,7 b' class patchheader(object):'
191 191 ci += 1
192 192 del self.comments[ci]
193 193
194 class queue:
194 class queue(object):
195 195 def __init__(self, ui, path, patchdir=None):
196 196 self.basepath = path
197 197 self.path = patchdir or os.path.join(path, "patches")
@@ -18,12 +18,12 b' import os, tempfile'
18 18 from mercurial import bundlerepo, changegroup, cmdutil, hg, merge, match
19 19 from mercurial import patch, revlog, util, error
20 20
21 class transplantentry:
21 class transplantentry(object):
22 22 def __init__(self, lnode, rnode):
23 23 self.lnode = lnode
24 24 self.rnode = rnode
25 25
26 class transplants:
26 class transplants(object):
27 27 def __init__(self, path=None, transplantfile=None, opener=None):
28 28 self.path = path
29 29 self.transplantfile = transplantfile
@@ -64,7 +64,7 b' class transplants:'
64 64 del self.transplants[self.transplants.index(transplant)]
65 65 self.dirty = True
66 66
67 class transplanter:
67 class transplanter(object):
68 68 def __init__(self, ui, repo):
69 69 self.ui = ui
70 70 self.path = repo.join('transplant')
@@ -34,7 +34,7 b' def tidyprefix(dest, prefix, suffixes):'
34 34 raise util.Abort(_('archive prefix contains illegal components'))
35 35 return prefix
36 36
37 class tarit:
37 class tarit(object):
38 38 '''write archive to tar file or stream. can write uncompressed,
39 39 or compress with gzip or bzip2.'''
40 40
@@ -106,7 +106,7 b' class tarit:'
106 106 def done(self):
107 107 self.z.close()
108 108
109 class tellable:
109 class tellable(object):
110 110 '''provide tell method for zipfile.ZipFile when writing to http
111 111 response file object.'''
112 112
@@ -124,7 +124,7 b' class tellable:'
124 124 def tell(self):
125 125 return self.offset
126 126
127 class zipit:
127 class zipit(object):
128 128 '''write archive to zip file or stream. can write uncompressed,
129 129 or compressed with deflate.'''
130 130
@@ -156,7 +156,7 b' class zipit:'
156 156 def done(self):
157 157 self.z.close()
158 158
159 class fileit:
159 class fileit(object):
160 160 '''write archive as files in directory.'''
161 161
162 162 def __init__(self, name, prefix, mtime):
@@ -36,7 +36,7 b' def encodeextra(d):'
36 36 items = [_string_escape('%s:%s' % (k, d[k])) for k in sorted(d)]
37 37 return "\0".join(items)
38 38
39 class appender:
39 class appender(object):
40 40 '''the changelog index must be updated last on disk, so we use this class
41 41 to delay writes to it'''
42 42 def __init__(self, fp, buf):
@@ -1110,7 +1110,7 b' def walkchangerevs(ui, repo, pats, chang'
1110 1110 fncache[rev] = matches
1111 1111 wanted.add(rev)
1112 1112
1113 class followfilter:
1113 class followfilter(object):
1114 1114 def __init__(self, onlyfirst=False):
1115 1115 self.startrev = nullrev
1116 1116 self.roots = []
@@ -2697,7 +2697,7 b' def serve(ui, repo, **opts):'
2697 2697 raise error.RepoError(_("There is no Mercurial repository here"
2698 2698 " (.hg not found)"))
2699 2699
2700 class service:
2700 class service(object):
2701 2701 def init(self):
2702 2702 util.set_signal_handler()
2703 2703 self.httpd = server.create_server(baseui, repo)
@@ -147,7 +147,7 b' GP_PATCH = 1 << 0 # we have to run pat'
147 147 GP_FILTER = 1 << 1 # there's some copy/rename operation
148 148 GP_BINARY = 1 << 2 # there's a binary patch
149 149
150 class patchmeta:
150 class patchmeta(object):
151 151 """Patched file metadata
152 152
153 153 'op' is the performed operation within ADD, DELETE, RENAME, MODIFY
@@ -232,7 +232,7 b' def readgitpatch(lr):'
232 232 unidesc = re.compile('@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@')
233 233 contextdesc = re.compile('(---|\*\*\*) (\d+)(,(\d+))? (---|\*\*\*)')
234 234
235 class patchfile:
235 class patchfile(object):
236 236 def __init__(self, ui, fname, opener, missing=False):
237 237 self.fname = fname
238 238 self.opener = opener
@@ -432,7 +432,7 b' class patchfile:'
432 432 self.rej.append(h)
433 433 return -1
434 434
435 class hunk:
435 class hunk(object):
436 436 def __init__(self, desc, num, lr, context, create=False, remove=False):
437 437 self.number = num
438 438 self.desc = desc
@@ -782,7 +782,7 b' def selectfile(afile_orig, bfile_orig, h'
782 782
783 783 return fname, missing
784 784
785 class linereader:
785 class linereader(object):
786 786 # simple class to allow pushing lines back into the input stream
787 787 def __init__(self, fp):
788 788 self.fp = fp
@@ -165,7 +165,7 b' def _calcmode(path):'
165 165
166 166 _data = 'data 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
167 167
168 class basicstore:
168 class basicstore(object):
169 169 '''base class for local repository stores'''
170 170 def __init__(self, path, opener, pathjoiner):
171 171 self.pathjoiner = pathjoiner
@@ -749,7 +749,7 b' def mktempcopy(name, emptyok=False, crea'
749 749 raise
750 750 return temp
751 751
752 class atomictempfile:
752 class atomictempfile(object):
753 753 """file-like object that atomically updates a file
754 754
755 755 All writes will be redirected to a temporary copy of the original
@@ -20,7 +20,7 b" def posixfile(name, mode='r', buffering="
20 20 raise WinIOError(err)
21 21 posixfile.__doc__ = osutil.posixfile.__doc__
22 22
23 class winstdout:
23 class winstdout(object):
24 24 '''stdout on windows misbehaves if sent through a pipe'''
25 25
26 26 def __init__(self, fp):
General Comments 0
You need to be logged in to leave comments. Login now