rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
ref_out = [''] | ref_out = [] | def run_one(test): vlog("# Test", test) if not verbose: sys.stdout.write('.') sys.stdout.flush() err = os.path.join(TESTDIR, test+".err") ref = os.path.join(TESTDIR, test+".out") if os.path.exists(err): os.remove(err) # Remove any previous output files # Make a tmp subdirectory to work in tmpd = os.path.join(H... |
hgwebobj = self.webdirmaker(self.server.webdir_conf) | hgwebobj = self.webdirmaker(self.webdir_conf) | def make_and_run_handler(self, req): if self.webdir_conf: hgwebobj = self.webdirmaker(self.server.webdir_conf) elif self.repo is not None: hgwebobj = self.repoviewmaker(repo.__class__(repo.ui, repo.origroot)) else: raise hg.RepoError(_('no repo found')) hgwebobj.run(req) |
mfa = self.manifest.readflags(m2n) | mfa = self.manifest.readflags(man) | def update(self, node, allow=False, force=False): pl = self.dirstate.parents() if not force and pl[1] != nullid: self.ui.warn("aborting: outstanding uncommitted merges\n") return |
commit_opts['force_editor'] = True; | commit_opts['force_editor'] = True | def backout(ui, repo, rev, **opts): '''reverse effect of earlier changeset Commit the backed out changes as a new changeset. The new changeset is a child of the backed out changeset. If you back out a changeset other than the tip, a new head is created. This head is the parent of the working directory. If you back... |
try: force_editor = opts['force_editor'] except KeyError: force_editor = False | def commit(ui, repo, *pats, **opts): """commit the specified files or all outstanding changes Commit changes to the given files into the repository. If a list of files is omitted, all changes reported by "hg status" will be committed. If no commit message is specified, the editor configured in your hgrc or in the ED... | |
force_editor=force_editor) | force_editor=opts.get('force_editor')) | def commit(ui, repo, *pats, **opts): """commit the specified files or all outstanding changes Commit changes to the given files into the repository. If a list of files is omitted, all changes reported by "hg status" will be committed. If no commit message is specified, the editor configured in your hgrc or in the ED... |
fetch = [] | fetch = {} | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
fetch.append(n[1]) | fetch[n[1]] = 1 | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
if b[0] not in m and b[0] not in seen: | if b[0] in m: self.ui.debug("found base node %s\n" % short(b[0])) base[b[0]] = 1 elif b[0] not in seen: | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
fetch.append(p) | fetch[p] = 1 | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
for f in fetch: | for f in fetch.keys(): | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
self.ui.note("adding new changesets starting at " + | self.ui.note("found new changesets starting at " + | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
return fetch | return fetch.keys() | def findincoming(self, remote, base=None, heads=None): m = self.changelog.nodemap search = [] fetch = [] seen = {} seenbranch = {} if base == None: base = {} |
if not req.url: port = req.env["SERVER_PORT"] port = port != "80" and (":" + port) or "" uri = req.env["REQUEST_URI"] if "?" in uri: uri = uri.split("?")[0] req.url = "http://%s%s%s" % (req.env["SERVER_NAME"], port, uri) | port = req.env["SERVER_PORT"] port = port != "80" and (":" + port) or "" urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port) | def sessionvars(**map): fields = [] if req.form.has_key('style'): style = req.form['style'][0] if style != self.repo.ui.config('web', 'style', ''): fields.append(('style', style)) |
"""raw commit interface | """raw commit interface (DEPRECATED) | def rawcommit(ui, repo, *flist, **rc): """raw commit interface (DEPRECATED) Lowlevel commit, for use in helper scripts. This command is not intended to be used by normal users, as it is primarily useful for importing from other SCMs. This command is now deprecated and will be removed in a future release, please use ... |
_('hg annotate [-r <rev> -u -n -c -d] [files ...]')), | _('hg annotate [-r REV] [-a] [-u] [-n] [-c] [-d] [FILES...]')), | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
_('hg export [-a] [-o filespec] REV...')), | _('hg export [-a] [-o OUTFILESPEC] REV...')), | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
_('hg tag [-l -m <text> -d <datecode> -u <user> -r <rev>] <name>')), | _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
m = max(map(len, l)) pieces.append(["%*s" % (m, x) for x in l]) for p, l in zip(zip(*pieces), lines): ui.write("%s: %s" % (" ".join(p), l[1])) | if l: m = max(map(len, l)) pieces.append(["%*s" % (m, x) for x in l]) if pieces: for p, l in zip(zip(*pieces), lines): ui.write("%s: %s" % (" ".join(p), l[1])) | def getname(rev): try: return bcache[rev] except KeyError: cl = repo.changelog.read(repo.changelog.node(rev)) name = cl[1] f = name.find('@') if f >= 0: name = name[:f] f = name.find('<') if f >= 0: name = name[f+1:] bcache[rev] = name return name |
ui.write(_(" One or more extensions could not be found," " check your build.\n")) | ui.write(_(" One or more extensions could not be found")) ui.write(_(" (check that you compiled the extensions)\n")) | def writetemp(contents): (fd, name) = tempfile.mkstemp() f = os.fdopen(fd, "wb") f.write(contents) f.close() return name |
while lb < lenb and b[lb] < a[la]: | while la < lena and lb < lenb and b[lb] < a[la]: | def sortdiff(a, b): la = lb = 0 lena = len(a) lenb = len(b) while 1: am, bm, = la, lb # walk over matching lines while lb < lenb and la < lena and a[la] == b[lb] : la += 1 lb += 1 if la > am: yield (am, bm, la - am) # return a match # skip mismatched lines from b while lb < lenb and b[lb] < a[la]: lb += 1 if lb >=... |
while la < lena and b[lb] > a[la]: | while la < lena and lb < lenb and b[lb] > a[la]: | def sortdiff(a, b): la = lb = 0 lena = len(a) lenb = len(b) while 1: am, bm, = la, lb # walk over matching lines while lb < lenb and la < lena and a[la] == b[lb] : la += 1 lb += 1 if la > am: yield (am, bm, la - am) # return a match # skip mismatched lines from b while lb < lenb and b[lb] < a[la]: lb += 1 if lb >=... |
filenode = hex(fn)) | filenode = hex(fn or nullid)) | def diffblock(diff, f, fn): yield self.t("diffblock", lines = prettyprintlines(diff), parity = parity[0], file = f, filenode = hex(fn)) parity[0] = 1 - parity[0] |
filenode = hex(mf[f]), file = f)) | filenode = hex(mf.get(f, nullid)), file = f)) | def changeset(self, nodeid): n = bin(nodeid) cl = self.repo.changelog changes = cl.read(n) p1, p2 = cl.parents(n) p1rev, p2rev = cl.rev(p1), cl.rev(p2) t = float(changes[2].split(' ')[0]) files = [] mf = self.repo.manifest.read(changes[0]) for f in changes[3]: files.append(self.t("filenodelink", filenode = hex(mf[f]),... |
norepo = ("clone init version help debugconfig debugdata" | norepo = ("clone init version help debugancestor debugconfig debugdata" | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
return filterfiles(p, files) | return filterfiles([p], files) | def relfilter(repo, files): if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return filterfiles(p, files) return files |
r = repo.file(file) | r = repo.file(relpath(repo, [file])[0]) | def cat(ui, repo, file, rev = []): """output the latest or given revision of a file""" r = repo.file(file) n = r.tip() if rev: n = r.lookup(rev) sys.stdout.write(r.read(n)) |
for fn in "dirstate", "lock": | for fn in "dirstate", "lock", "hgrc", "localtags": | def __del__(self): if self.dir_: self.rmtree(self.dir_, True) |
cfg = ConfigParser.SafeConfigParser() try: fp = repo.opener('hgrc', 'r') os.unlink(fp.name) cfg.readfp(fp) except IOError, inst: if inst.errno != errno.ENOENT: raise if not cfg.has_section('paths'): cfg.add_section('paths') cfg.set('paths', 'default', abspath) cfg.write(repo.opener('hgrc', 'w')) | f = repo.opener("hgrc", "w") f.write("[paths]\n") f.write("default = %s\n" % abspath) | def __del__(self): if self.dir_: self.rmtree(self.dir_, True) |
show_changeset(du, repo, rev) | br = None if opts['branch']: br = repo.branchlookup([repo.changelog.node(rev)]) show_changeset(du, repo, rev, brinfo=br) | def __getattr__(self, key): return getattr(self.ui, key) |
guards control whether a patch can be pushed. a patch with no guards is aways pushed. a patch with posative guard ("+foo") is pushed only if qselect command enables guard "foo". a patch with nagative guard ("-foo") is never pushed if qselect command enables guard "foo". with no arguments, default is to print curren... | Guards control whether a patch can be pushed. A patch with no guards is always pushed. A patch with a positive guard ("+foo") is pushed only if the qselect command has activated it. A patch with a negative guard ("-foo") is never pushed if the qselect command has activated it. With no arguments, print the currently ac... | def guard(ui, repo, *args, **opts): '''set or print guards for a patch guards control whether a patch can be pushed. a patch with no guards is aways pushed. a patch with posative guard ("+foo") is pushed only if qselect command enables guard "foo". a patch with nagative guard ("-foo") is never pushed if qselect com... |
to set guards on other patch: | To set guards on another patch: | def guard(ui, repo, *args, **opts): '''set or print guards for a patch guards control whether a patch can be pushed. a patch with no guards is aways pushed. a patch with posative guard ("+foo") is pushed only if qselect command enables guard "foo". a patch with nagative guard ("-foo") is never pushed if qselect com... |
use qguard command to set or print guards on patch. then use qselect to tell mq which guards to use. example: qguard foo.patch -stable (nagative guard) qguard bar.patch +stable (posative guard) | Use the qguard command to set or print guards on patch, then use qselect to tell mq which guards to use. A patch will be pushed if it has no guards or any positive guards match the currently selected guard, but will not be pushed if any negative guards match the current guard. For example: qguard foo.patch -stable ... | def select(ui, repo, *args, **opts): '''set or print guarded patches to push use qguard command to set or print guards on patch. then use qselect to tell mq which guards to use. example: qguard foo.patch -stable (nagative guard) qguard bar.patch +stable (posative guard) qselect stable this sets "stable" guar... |
this sets "stable" guard. mq will skip foo.patch (because it has nagative match) but push bar.patch (because it has posative match). patch is pushed if any posative guards match and no nagative guards match. with no arguments, default is to print current active guards. with arguments, set active guards as given. | This activates the "stable" guard. mq will skip foo.patch (because it has a negative match) but push bar.patch (because it has a positive match). With no arguments, prints the currently active guards. With one argument, sets the active guard. | def select(ui, repo, *args, **opts): '''set or print guarded patches to push use qguard command to set or print guards on patch. then use qselect to tell mq which guards to use. example: qguard foo.patch -stable (nagative guard) qguard bar.patch +stable (posative guard) qselect stable this sets "stable" guar... |
use -n/--none to deactivate guards (no other arguments needed). when no guards active, patches with posative guards are skipped, patches with nagative guards are pushed. qselect can change guards of applied patches. it does not pop guarded patches by default. use --pop to pop back to last applied patch that is not gu... | Use -n/--none to deactivate guards (no other arguments needed). When no guards are active, patches with positive guards are skipped and patches with negative guards are pushed. qselect can change the guards on applied patches. It does not pop guarded patches by default. Use --pop to pop back to the last applied patch ... | def select(ui, repo, *args, **opts): '''set or print guarded patches to push use qguard command to set or print guards on patch. then use qselect to tell mq which guards to use. example: qguard foo.patch -stable (nagative guard) qguard bar.patch +stable (posative guard) qselect stable this sets "stable" guar... |
if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return filterfiles([util.pconvert(p)], files) | cwd = repo.getcwd() if cwd: return filterfiles([util.pconvert(cwd)], files) | def relfilter(repo, files): if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return filterfiles([util.pconvert(p)], files) return files |
if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return [ util.pconvert(os.path.normpath(os.path.join(p, x))) for x in args ] | cwd = repo.getcwd() if cwd: return [ util.pconvert(os.path.normpath(os.path.join(cwd, x))) for x in args ] | def relpath(repo, args): if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return [ util.pconvert(os.path.normpath(os.path.join(p, x))) for x in args ] return args |
ctx = repo.changectx(opts['rev'] or -1) | ctx = repo.changectx(opts['rev'] or "-1") | def cat(ui, repo, file1, *pats, **opts): """output the latest or given revisions of files Print the specified files as they were at the given revision. If no revision is given then the tip is used. Output may be to a file, in which case the name of the file is given using a format string. The formatting rules are th... |
parent = revlog.hex(self.dirstate.parents()[0]) if parent in [s.rev for s in self.mq.applied]: raise util.Abort(_('cannot commit over an applied mq patch')) return super(mqrepo, self).commit(*args, **opts) | raise util.Abort(_('source has mq patches applied')) return super(mqrepo, self).push(remote, force, revs) | def commit(self, *args, **opts): if len(args) >= 6: force = args[5] else: force = opts.get('force') if self.mq.applied and not force: parent = revlog.hex(self.dirstate.parents()[0]) if parent in [s.rev for s in self.mq.applied]: raise util.Abort(_('cannot commit over an applied mq patch')) |
os.path.join("data", path + ".i"), os.path.join("data", path + ".d")) | os.path.join("data", self.encodedir(path + ".i")), os.path.join("data", self.encodedir(path + ".d"))) def encodedir(self, path): path.replace(".hg/", ".hg.hg/") path.replace(".i/", ".i.hg/") path.replace(".d/", ".i.hg/") return path def decodedir(self, path): path.replace(".d.hg/", ".d/") path.replace(".i.hg/", ".i... | def __init__(self, opener, path): revlog.__init__(self, opener, os.path.join("data", path + ".i"), os.path.join("data", path + ".d")) |
(added, revert, forget, True, True), | (added, revert, forget, True, False), | def revert(ui, repo, *pats, **opts): """revert modified files or dirs back to their unmodified states In its default mode, it reverts any uncommitted modifications made to the named files or directories. This restores the contents of the affected files to an unmodified state. Modified files are saved with a .orig su... |
elif getattr(inst, "strerror", None): u.warn("abort: %s\n" % inst.strerror) | def print_time(): t = get_times() u.warn("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n" % (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) | |
for r in nodes: for k in revs[r]: r = "%5d:%s" % (r, hgnode.hex(repo.changelog.node(r))) | for rev in nodes: for k in revs[rev]: r = "%5d:%s" % (rev, hgnode.hex(repo.changelog.node(rev))) | def sigs(ui, repo): """list signed changesets""" mygpg = newgpg(ui) revs = {} for data, context in sigwalk(repo): node, version, sig = data fn, ln = context try: n = repo.lookup(node) except KeyError: ui.warn(_("%s:%d node does not exist\n") % (fn, ln)) continue r = repo.changelog.rev(n) keys = getkeys(ui, repo, mygpg... |
_("hg sign [OPTION]... REVISIONS")), | _("hg sign [OPTION]... [REVISION]...")), | def node2txt(repo, node, ver): """map a manifest into some text""" if ver == "0": return "%s\n" % hgnode.hex(node) else: util.Abort(_("unknown signature version")) |
def patch(ui, repo, patches, opts): | def patch(ui, repo, patches, **opts): | def patch(ui, repo, patches, opts): """import an ordered set of patches""" try: import psyco psyco.full() except: pass d = opts["base"] strip = opts["strip"] quiet = opts["quiet"] and "> /dev/null" or "" for patch in patches: ui.status("applying %s\n" % patch) pf = os.path.join(d, patch) text = "" for l in file(pf):... |
def rawcommit(ui, repo, files, rc): | def rawcommit(ui, repo, files, **rc): | def rawcommit(ui, repo, files, rc): "raw commit interface" text = rc['text'] if not text and rc['logfile']: try: text = open(rc['logfile']).read() except IOError: pass if not text and not rc['logfile']: print "missing commit text" return 1 files = relpath(repo, files) if rc['files']: files += open(rc['files']).read()... |
return hg.update(repo, repo.changelog.tip(), wlock=wlock) | return hg.clean(repo, repo.changelog.tip(), wlock=wlock) | def postincoming(other, modheads): if modheads == 0: return 0 if modheads == 1: return hg.update(repo, repo.changelog.tip(), wlock=wlock) newheads = repo.heads(parent) newchildren = [n for n in repo.heads(parent) if n != parent] newparent = parent if newchildren: newparent = newchildren[0] hg.update(repo, newparent, wl... |
hg.update(repo, newparent, wlock=wlock) | hg.clean(repo, newparent, wlock=wlock) | def postincoming(other, modheads): if modheads == 0: return 0 if modheads == 1: return hg.update(repo, repo.changelog.tip(), wlock=wlock) newheads = repo.heads(parent) newchildren = [n for n in repo.heads(parent) if n != parent] newparent = parent if newchildren: newparent = newchildren[0] hg.update(repo, newparent, wl... |
repo.addchangegroup(util.chunkbuffer(bzgen)) | if repo.addchangegroup(util.chunkbuffer(bzgen)): return 1 | def bzgenerator(f): zd = bz2.BZ2Decompressor() for chunk in f: yield zd.decompress(chunk) |
def __init__(self): page.__init__(self, title="Mercurial Web Error Page") | def __init__(self, tmpl_dir): page.__init__(self, tmpl_dir, title="Mercurial Web Error Page") | def __init__(self): page.__init__(self, title="Mercurial Web Error Page") |
page = errpage() | page = errpage(self.tmpl_dir) | def run(self): |
return output_line[14:] | pf = output_line[14:] if pf.startswith("'") and pf.endswith("'") and pf.find(" ") >= 0: pf = pf[1:-1] return pf | def parse_patch_output(output_line): """parses the output produced by patch and returns the file name""" return output_line[14:] |
def trimuser(ui, name, rev, revcache): """trim the name of the user who committed a change""" user = revcache.get(rev) if user is None: user = revcache[rev] = ui.shortuser(name) return user | def flush(self): return "" | |
ucache = {} | def difflinestates(a, b): sm = difflib.SequenceMatcher(None, a, b) for tag, alo, ahi, blo, bhi in sm.get_opcodes(): if tag == 'insert': for i in xrange(blo, bhi): yield ('+', b[i]) elif tag == 'delete': for i in xrange(alo, ahi): yield ('-', a[i]) elif tag == 'replace': for i in xrange(alo, ahi): yield ('-', a[i]) for ... | |
a, b = prevstates, states | a, b, r = prevstates, states, rev | def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if incrementing or not opts['all']: a, b = prevstates, states else: a, b = states, prevstates for change, l in difflinestates(a, b): if incrementing or not opts['all']: r = rev else: r = prev[fn] cols = [fn, str(r)] if opts['line_nu... |
a, b = states, prevstates | a, b, r = states, prevstates, prev.get(fn, -1) | def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if incrementing or not opts['all']: a, b = prevstates, states else: a, b = states, prevstates for change, l in difflinestates(a, b): if incrementing or not opts['all']: r = rev else: r = prev[fn] cols = [fn, str(r)] if opts['line_nu... |
if incrementing or not opts['all']: r = rev else: r = prev[fn] | def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if incrementing or not opts['all']: a, b = prevstates, states else: a, b = states, prevstates for change, l in difflinestates(a, b): if incrementing or not opts['all']: r = rev else: r = prev[fn] cols = [fn, str(r)] if opts['line_nu... | |
cols.append(trimuser(ui, getchange(r)[1], rev, ucache)) | cols.append(ui.shortuser(getchange(r)[1])) | def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if incrementing or not opts['all']: a, b = prevstates, states else: a, b = states, prevstates for change, l in difflinestates(a, b): if incrementing or not opts['all']: r = rev else: r = prev[fn] cols = [fn, str(r)] if opts['line_nu... |
c = (fn, rev) | c = (fn, r) | def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if incrementing or not opts['all']: a, b = prevstates, states else: a, b = states, prevstates for change, l in difflinestates(a, b): if incrementing or not opts['all']: r = rev else: r = prev[fn] cols = [fn, str(r)] if opts['line_nu... |
print "copying %s to %s" % (src, dst) | def dogitpatch(patchname, gitpatches): """Preprocess git patch so that vanilla patch can handle it""" pf = file(patchname) pfline = 1 fd, patchname = tempfile.mkstemp(prefix='hg-patch-') tmpfp = os.fdopen(fd, 'w') try: for i in range(len(gitpatches)): p = gitpatches[i] if not p.copymod: continue if os.path.exists(p.... | |
return system_rcpath() + [os.path.join(os.path.expanduser('~'), 'mercurial.ini')] | path = system_rcpath() path.append(os.path.join(os.path.expanduser('~'), 'mercurial.ini')) userprofile = os.environ.get('USERPROFILE') if userprofile: path.append(os.path.join(userprofile, 'mercurial.ini')) return path | def os_rcpath(): '''return default os-specific hgrc search path''' return system_rcpath() + [os.path.join(os.path.expanduser('~'), 'mercurial.ini')] |
return self.ignore(fn) and False or match(fn) | if self.ignore(fn): return False return match(fn) | def checkappend(l, fn): if match is util.always or match(fn): l.append(fn) |
return smtp(ui) | return _smtp(ui) | def connect(ui): '''make a mail connection. object returned has one method, sendmail. call as sendmail(sender, list-of-recipients, msg).''' method = ui.config('email', 'method', 'smtp') if method == 'smtp': return smtp(ui) return sendmail(ui, method) |
return sendmail(ui, method) | return _sendmail(ui, method) | def connect(ui): '''make a mail connection. object returned has one method, sendmail. call as sendmail(sender, list-of-recipients, msg).''' method = ui.config('email', 'method', 'smtp') if method == 'smtp': return smtp(ui) return sendmail(ui, method) |
ui.warn("unknown command %s" % cmd) | ui.warn("hg: unknown command %s\n" % cmd) | def help(ui, cmd=None): '''show help for a given command or all commands''' if cmd: try: i = find(cmd) ui.write("%s\n\n" % i[2]) ui.write(i[0].__doc__, "\n") except UnknownCommand: ui.warn("unknown command %s" % cmd) sys.exit(0) else: ui.status('hg commands:\n\n') h = {} for e in table.values(): f = e[0] if f.__name__... |
prune_filenodes(fname, filerevlog) msng_filenode_lst = msng_filenode_set[fname].keys() | if msng_filenode_set.has_key(fname): prune_filenodes(fname, filerevlog) msng_filenode_lst = msng_filenode_set[fname].keys() else: msng_filenode_lst = [] | def gengroup(): # The set of changed files starts empty. changedfiles = {} # Create a changenode group generator that will call our functions # back to lookup the owning changenode and collect information. group = cl.group(msng_cl_lst, identity, manifest_and_file_collector(changedfiles)) for chnk in group: yield chnk |
del msng_filenode_set[fname] | if msng_filenode_set.has_key(fname): del msng_filenode_set[fname] | def gengroup(): # The set of changed files starts empty. changedfiles = {} # Create a changenode group generator that will call our functions # back to lookup the owning changenode and collect information. group = cl.group(msng_cl_lst, identity, manifest_and_file_collector(changedfiles)) for chnk in group: yield chnk |
addr, port = self.socket.getsockname() if addr == '0.0.0.0': | addr, port = self.socket.getsockname()[:2] if addr in ('0.0.0.0', '::'): | def __init__(self, *args, **kargs): BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs) self.accesslog = accesslog self.errorlog = errorlog self.repo = repo self.webdir_conf = webdir_conf self.webdirmaker = hgwebdir self.repoviewmaker = hgweb self.reqmaker = wsgiapplication(self.make_handler) self.daemon_threads =... |
print m | def footer(**map): yield self.t("footer", **map) | |
if l[:4] == "--- ": break | if l.startswith("--- ") or l.startswith("diff -r"): break | def import_(ui, repo, patch1, *patches, **opts): """import an ordered set of patches""" try: import psyco psyco.full() except: pass patches = (patch1,) + patches d = opts["base"] strip = opts["strip"] for patch in patches: ui.status("applying %s\n" % patch) pf = os.path.join(d, patch) text = "" for l in file(pf): i... |
self.url = path | s = urlparse.urlsplit(path) partial = s[2] if not partial: partial = "/" self.url = urlparse.urlunsplit((s[0], s[1], partial, '', '')) | def __init__(self, ui, path): self.url = path self.ui = ui no_list = [ "localhost", "127.0.0.1" ] host = ui.config("http_proxy", "host") if host is None: host = os.environ.get("http_proxy") if host and host.startswith('http://'): host = host[7:] user = ui.config("http_proxy", "user") passwd = ui.config("http_proxy", "p... |
line = fp.readline() | line = fp.readline().rstrip() | def extractbin(fp): line = fp.readline() while line and not line.startswith('literal '): line = fp.readline() if not line: return size = int(line[8:].rstrip()) dec = [] line = fp.readline() while line: line = line[1:-1] dec.append(base85.b85decode(line)) line = fp.readline() text = zlib.decompress(''.join(dec)) if len(... |
size = int(line[8:].rstrip()) | size = int(line[8:]) | def extractbin(fp): line = fp.readline() while line and not line.startswith('literal '): line = fp.readline() if not line: return size = int(line[8:].rstrip()) dec = [] line = fp.readline() while line: line = line[1:-1] dec.append(base85.b85decode(line)) line = fp.readline() text = zlib.decompress(''.join(dec)) if len(... |
line = line[1:-1] dec.append(base85.b85decode(line)) line = fp.readline() | l = line[0] if l <= 'Z' and l >= 'A': l = ord(l) - ord('A') + 1 else: l = ord(l) - ord('a') + 27 dec.append(base85.b85decode(line[1:])[:l]) line = fp.readline().rstrip() | def extractbin(fp): line = fp.readline() while line and not line.startswith('literal '): line = fp.readline() if not line: return size = int(line[8:].rstrip()) dec = [] line = fp.readline() while line: line = line[1:-1] dec.append(base85.b85decode(line)) line = fp.readline() text = zlib.decompress(''.join(dec)) if len(... |
def show_changeset(ui, repo, rev=0, changenode=None, brinfo=None): """show a single changeset or file revision""" log = repo.changelog if changenode is None: changenode = log.node(rev) elif not rev: rev = log.rev(changenode) if ui.quiet: ui.write("%d:%s\n" % (rev, short(changenode))) return changes = log.read(changen... | class changeset_templater(object): def __init__(self, ui, repo, mapfile): self.t = templater.templater(mapfile, templater.common_filters) self.ui = ui self.repo = repo def use_template(self, t): self.t.cache['template'] = t def write(self, thing): for t in thing: if hasattr(t, '__iter__'): self.write(t) else: self.ui... | def show_changeset(ui, repo, rev=0, changenode=None, brinfo=None): """show a single changeset or file revision""" log = repo.changelog if changenode is None: changenode = log.node(rev) elif not rev: rev = log.rev(changenode) if ui.quiet: ui.write("%d:%s\n" % (rev, short(changenode))) return changes = log.read(changen... |
ui.write(_("changeset: %d:%s\n") % (rev, short(changenode))) for tag in repo.nodetags(changenode): ui.status(_("tag: %s\n") % tag) for parent in parents: ui.write(_("parent: %d:%s\n") % parent) if brinfo and changenode in brinfo: br = brinfo[changenode] ui.write(_("branch: %s\n") % " ".join(br)) ... | tmpl = ui.config('ui', 'logtemplate') if tmpl: tmpl = templater.parsestring(tmpl) mapfile = opts.get('map_file') or ui.config('ui', 'logmap') if tmpl or mapfile: if mapfile: if not os.path.isfile(mapfile): mapname = templater.templatepath(mapfile) if mapname: mapfile = mapname try: t = changeset_templater(ui, repo, map... | def show_changeset(ui, repo, rev=0, changenode=None, brinfo=None): """show a single changeset or file revision""" log = repo.changelog if changenode is None: changenode = log.node(rev) elif not rev: rev = log.rev(changenode) if ui.quiet: ui.write("%d:%s\n" % (rev, short(changenode))) return changes = log.read(changen... |
show_changeset(ui, repo, changenode=n, brinfo=br) | displayer.show(changenode=n, brinfo=br) | def heads(ui, repo, **opts): """show current repository heads Show all repository head changesets. Repository "heads" are changesets that don't have children changesets. They are where development generally takes place and are the usual targets for update and merge operations. """ if opts['rev']: heads = repo.heads(r... |
show_changeset(ui, other, changenode=n) | displayer.show(changenode=n) | def incoming(ui, repo, source="default", **opts): """show new changesets found in source Show new changesets found in the specified repo or the default pull repo. These are the changesets that would be pulled if a pull was requested. Currently only local repositories are supported. """ source = ui.expandpath(source, ... |
show_changeset(du, repo, rev, brinfo=br) | displayer.show(rev, brinfo=br) | def __getattr__(self, key): return getattr(self.ui, key) |
show_changeset(ui, repo, changenode=n) | displayer.show(changenode=n) | def outgoing(ui, repo, dest="default-push", **opts): """show changesets not found in destination Show changesets not found in the specified destination repo or the default push repo. These are the changesets that would be pushed if a push was requested. """ dest = ui.expandpath(dest, repo.root) other = hg.repository(u... |
def parents(ui, repo, rev=None, branches=None): | def parents(ui, repo, rev=None, branches=None, **opts): | def parents(ui, repo, rev=None, branches=None): """show the parents of the working dir or revision Print the working directory's parent revisions. """ if rev: p = repo.changelog.parents(repo.lookup(rev)) else: p = repo.dirstate.parents() br = None if branches is not None: br = repo.branchlookup(p) for n in p: if n !=... |
show_changeset(ui, repo, changenode=n, brinfo=br) | displayer.show(changenode=n, brinfo=br) | def parents(ui, repo, rev=None, branches=None): """show the parents of the working dir or revision Print the working directory's parent revisions. """ if rev: p = repo.changelog.parents(repo.lookup(rev)) else: p = repo.dirstate.parents() br = None if branches is not None: br = repo.branchlookup(p) for n in p: if n !=... |
show_changeset(ui, repo, changenode=n, brinfo=br) | show_changeset(ui, repo, opts).show(changenode=n, brinfo=br) | def tip(ui, repo, **opts): """show the tip revision Show the tip revision. """ n = repo.changelog.tip() br = None if opts['branches']: br = repo.branchlookup([n]) show_changeset(ui, repo, changenode=n, brinfo=br) if opts['patch']: dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n) |
branch=None): | branch=None, **opts): | def update(ui, repo, node=None, merge=False, clean=False, force=None, branch=None): """update or merge working directory Update the working directory to the specified revision. If there are no outstanding changes in the working directory and there is a linear relationship between the current version and the requested... |
show_changeset(ui, repo, changenode=x, brinfo=br) | show_changeset(ui, repo, opts).show(changenode=x, brinfo=br) | def update(ui, repo, node=None, merge=False, clean=False, force=None, branch=None): """update or merge working directory Update the working directory to the specified revision. If there are no outstanding changes in the working directory and there is a linear relationship between the current version and the requested... |
('r', 'rev', '', _('show only heads which are descendants of rev'))], | ('', 'map-file', '', _('display using template map file')), ('r', 'rev', '', _('show only heads which are descendants of rev')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
('n', 'newest-first', None, _('show newest record first'))], | ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
('p', 'patch', None, _('show patch'))], | ('p', 'patch', None, _('show patch')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
('n', 'newest-first', None, _('show newest record first'))], | ('', 'map-file', '', _('display using template map file')), ('n', 'newest-first', None, _('show newest record first')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
[('b', 'branches', None, _('show branches'))], | [('b', 'branches', None, _('show branches')), ('', 'map-file', '', _('display using template map file')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
('p', 'patch', None, _('show patch'))], | ('', 'map-file', '', _('display using template map file')), ('p', 'patch', None, _('show patch')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
('f', 'force', None, _('force a merge with outstanding changes'))], | ('f', 'force', None, _('force a merge with outstanding changes')), ('t', 'template', '', _('display with template'))], | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
"addremove": | "debugaddremove|addremove": | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
[('A', 'addremove', None, _('run addremove during commit')), | [('A', 'addremove', None, _('mark new/missing files as added/removed before committing')), | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
"footer": footer}) | "footer": footer, "url": url}) | def footer(**map): yield tmpl("footer", motd=self.motd, **map) |
def debugconfig(ui, repo, *values): | def showconfig(ui, repo, *values): | def debugconfig(ui, repo, *values): """show combined config settings from all hgrc files With no args, print names and values of all config items. With one arg of the form section.name, print just the value of that config item. With multiple args, print names and values of all config items with matching section name... |
"debugconfig": (debugconfig, [], _('debugconfig [NAME]...')), | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... | |
optionalrepo = ("paths serve debugconfig") | optionalrepo = ("paths serve showconfig") | def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crossli... |
shortlog = changelist) | shortlog = changelist, archives=self.archivelist("tip")) | def changelist(**map): parity = 0 cl = self.repo.changelog l = [] # build a list in forward order for efficiency for i in range(start, end): n = cl.node(i) changes = cl.read(n) hn = hex(n) t = changes[2] |
except ImportError: pass | except ImportError: py2exe_for_demandload = None | def finalize_options(self): # Get the build directory, ie. where to search for modules. self.set_undefined_options('build', ('build_lib', 'build_lib')) # Sets the 'includes' option with the list of needed modules if not self.includes: self.includes = [] self.includes += mercurial.packagescan.getmodules(self.build_lib,'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.