rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if info: | if info and not forget: | def delete(self, repo, patches, keep=False): realpatches = [] for patch in patches: patch = self.lookup(patch, strict=True) info = self.isapplied(patch) if info: raise util.Abort(_("cannot delete applied patch %s") % patch) if patch not in self.series: raise util.Abort(_("patch %s not in series file") % patch) realpatc... |
if not keep: | if not opts.get('keep'): | def delete(self, repo, patches, keep=False): realpatches = [] for patch in patches: patch = self.lookup(patch, strict=True) info = self.isapplied(patch) if info: raise util.Abort(_("cannot delete applied patch %s") % patch) if patch not in self.series: raise util.Abort(_("patch %s not in series file") % patch) realpatc... |
The patches must not be applied. With -k, the patch files are preserved in the patch directory.""" | With --forget, mq will stop managing the named patches. The patches must be applied and at the base of the stack. This option is useful when the patches have been applied upstream. Otherwise, the patches must not be applied. With --keep, the patch files are preserved in the patch directory.""" | def delete(ui, repo, patch, *patches, **opts): """remove patches from queue The patches must not be applied. With -k, the patch files are preserved in the patch directory.""" q = repo.mq q.delete(repo, (patch,) + patches, keep=opts.get('keep')) q.save_dirty() return 0 |
q.delete(repo, (patch,) + patches, keep=opts.get('keep')) | q.delete(repo, (patch,) + patches, opts) | def delete(ui, repo, patch, *patches, **opts): """remove patches from queue The patches must not be applied. With -k, the patch files are preserved in the patch directory.""" q = repo.mq q.delete(repo, (patch,) + patches, keep=opts.get('keep')) q.save_dirty() return 0 |
[('k', 'keep', None, _('keep patch file'))], 'hg qdelete [-k] PATCH'), | [('f', 'forget', None, _('stop managing an applied patch')), ('k', 'keep', None, _('keep patch file'))], 'hg qdelete [-f] [-k] PATCH'), | def tags(self): if self.tagscache: return self.tagscache |
fp = open(expand(opts['output']), 'w') | fp = open(expand(opts['output']), 'wb') | def expand(name): expansions = { '%': lambda: '%', 'H': lambda: hg.hex(node), 'N': lambda: str(total), 'R': lambda: str(repo.changelog.rev(node)), 'b': lambda: os.path.basename(repo.root), 'h': lambda: hg.short(node), 'n': lambda: str(seqno).zfill(len(str(total))), 'r': lambda: str(repo.changelog.rev(node)).zfill(revwi... |
def rawcommit(ui, repo, files, **rc): | def rawcommit(ui, repo, flist, **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... |
files = relpath(repo, files) | files = relpath(repo, flist) | 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... |
p = os.path.join(self.templates, b) | p = os.path.join(t, b) | def footer(**map): yield self.t("footer", **map) |
self.addlist = None | def __init__(self, opener): self.mapcache = None self.listcache = None self.addlist = None revlog.__init__(self, opener, "00manifest.i", "00manifest.d") | |
self.listcache = (text, text.splitlines(1)) for l in self.listcache[1]: | self.listcache = array.array('c', text) lines = text.splitlines(1) for l in lines: | def read(self, node): if node == nullid: return {} # don't upset local cache if self.mapcache and self.mapcache[0] == node: return self.mapcache[1] text = self.revision(node) map = {} flag = {} self.listcache = (text, text.splitlines(1)) for l in self.listcache[1]: (f, n) = l.split('\0') map[f] = bin(n[:40]) flag[f] = ... |
def gendelta(delta): i = 0 result = [] while i < len(delta): start = delta[i][2] end = delta[i][3] l = delta[i][4] if l == None: l = "" while i < len(delta) - 1 and start <= delta[i+1][2] \ and end >= delta[i+1][2]: if delta[i+1][3] > end: end = delta[i+1][3] if delta[i+1][4]: l += delta[i+1][4] | def manifestsearch(m, s, lo=0, hi=None): def advance(i, c): while i < lenm and m[i] != c: | def add(self, map, flags, transaction, link, p1=None, p2=None, changed=None): # directly generate the mdiff delta from the data collected during # the bisect loop below def gendelta(delta): i = 0 result = [] while i < len(delta): start = delta[i][2] end = delta[i][3] l = delta[i][4] if l == None: l = "" while i < len(d... |
result.append(struct.pack(">lll", start, end, len(l)) + l) i += 1 return result | return i lenm = len(m) if not hi: hi = lenm while lo < hi: mid = (lo + hi) // 2 start = mid while start > 0 and m[start-1] != '\n': start -= 1 end = advance(start, '\0') if m[start:end] < s: lo = advance(end + 40, '\n') + 1 else: hi = start end = advance(lo, '\0') found = m[lo:end] if cmp(s, found) == 0: end = adva... | def gendelta(delta): i = 0 result = [] while i < len(delta): start = delta[i][2] end = delta[i][3] l = delta[i][4] if l == None: l = "" while i < len(delta) - 1 and start <= delta[i+1][2] \ and end >= delta[i+1][2]: if delta[i+1][3] > end: end = delta[i+1][3] if delta[i+1][4]: l += delta[i+1][4] i += 1 result.append(st... |
def addlistdelta(addlist, delta): | def addlistdelta(addlist, x): | def addlistdelta(addlist, delta): # apply the deltas to the addlist. start from the bottom up # so changes to the offsets don't mess things up. i = len(delta) while i > 0: i -= 1 start = delta[i][0] end = delta[i][1] if delta[i][4]: addlist[start:end] = [delta[i][4]] else: del addlist[start:end] return addlist |
i = len(delta) | i = len(x) | def addlistdelta(addlist, delta): # apply the deltas to the addlist. start from the bottom up # so changes to the offsets don't mess things up. i = len(delta) while i > 0: i -= 1 start = delta[i][0] end = delta[i][1] if delta[i][4]: addlist[start:end] = [delta[i][4]] else: del addlist[start:end] return addlist |
start = delta[i][0] end = delta[i][1] if delta[i][4]: addlist[start:end] = [delta[i][4]] | start = x[i][0] end = x[i][1] if x[i][2]: addlist[start:end] = array.array('c', x[i][2]) | def addlistdelta(addlist, delta): # apply the deltas to the addlist. start from the bottom up # so changes to the offsets don't mess things up. i = len(delta) while i > 0: i -= 1 start = delta[i][0] end = delta[i][1] if delta[i][4]: addlist[start:end] = [delta[i][4]] else: del addlist[start:end] return addlist |
return addlist def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets | return "".join([struct.pack(">lll", d[0], d[1], len(d[2])) + d[2] \ for d in x ]) | def addlistdelta(addlist, delta): # apply the deltas to the addlist. start from the bottom up # so changes to the offsets don't mess things up. i = len(delta) while i > 0: i -= 1 start = delta[i][0] end = delta[i][1] if delta[i][4]: addlist[start:end] = [delta[i][4]] else: del addlist[start:end] return addlist |
self.addlist = ["%s\000%s%s\n" % | text = ["%s\000%s%s\n" % | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
addlist = self.listcache[1] offsets = calcoffsets(addlist) | addlist = self.listcache | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
bs = 0 | dstart = None dend = None dline = [""] start = 0 addbuf = buffer(addlist) | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
bs = bisect.bisect(addlist, f, bs) if bs < len(addlist): fn = addlist[bs][:addlist[bs].index('\0')] else: fn = None | start, end = manifestsearch(addbuf, f, start) | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
l = None start = bs if fn != f: end = bs if w[1] == 1: raise AssertionError( | l = "" if start == end and w[1] == 1: raise AssertionError( | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
end = bs + 1 delta.append([start, end, offsets[start], offsets[end], l]) | if dstart != None: delta.append([dstart, dend, "".join(dline)]) dstart = start dend = end dline = [l] | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
self.addlist = addlistdelta(addlist, delta) if self.mapcache[0] == self.tip(): cachedelta = "".join(gendelta(delta)) else: | if dstart != None: delta.append([dstart, dend, "".join(dline)]) cachedelta = addlistdelta(addlist, delta) if self.mapcache[0] != self.tip(): | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
text = "".join(self.addlist) if cachedelta and mdiff.patch(self.listcache[0], cachedelta) != text: raise AssertionError(_("manifest delta failure\n")) n = self.addrevision(text, transaction, link, p1, p2, cachedelta) | n = self.addrevision(buffer(self.listcache), transaction, link, p1, \ p2, cachedelta) | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets |
self.listcache = (text, self.addlist) self.addlist = None | def calcoffsets(addlist): offsets = [0] * (len(addlist) + 1) offset = 0 i = 0 while i < len(addlist): offsets[i] = offset offset += len(addlist[i]) i += 1 offsets[i] = offset return offsets | |
change = repo.changelog.read(node1) mmap = repo.manifest.read(change[0]) date1 = util.datestr(change[2]) | def read(f): return repo.wread(f) | |
if len(c) > 1: raise KeyError("Ambiguous identifier") if len(c) < 1: raise KeyError("No match found") | if len(c) > 1: raise RevlogError("Ambiguous identifier") if len(c) < 1: raise RevlogError("No match found") | def lookup(self, id): """locate a node based on revision number or subset of hex nodeid""" try: rev = int(id) if str(rev) != id: raise ValueError if rev < 0: rev = self.count() + rev if rev < 0 or rev >= self.count(): raise ValueError return self.node(rev) except (ValueError, OverflowError): c = [] for n in self.nodema... |
mf1 = mfmatches(node1) | def mfmatches(node): change = self.changelog.read(node) mf = dict(self.manifest.read(change[0])) for fn in mf.keys(): if not match(fn): del mf[fn] return mf | |
if not proto.startswith('application/mercurial') and \ | if not proto.startswith('application/mercurial-') and \ | def do_cmd(self, cmd, **args): data = args.pop('data', None) headers = args.pop('headers', {}) self.ui.debug(_("sending %s command\n") % cmd) q = {"cmd": cmd} q.update(args) qs = '?%s' % urllib.urlencode(q) cu = "%s%s" % (self._url, qs) try: if data: self.ui.debug(_("sending %s bytes\n") % headers.get('content-length',... |
if proto.startswith('application/mercurial'): version = proto[22:] if float(version) > 0.1: | if proto.startswith('application/mercurial-'): try: version = float(proto[22:]) except ValueError: raise hg.RepoError(_("'%s' sent a broken Content-type " "header (%s)") % (self._url, proto)) if version > 0.1: | def do_cmd(self, cmd, **args): data = args.pop('data', None) headers = args.pop('headers', {}) self.ui.debug(_("sending %s command\n") % cmd) q = {"cmd": cmd} q.update(args) qs = '?%s' % urllib.urlencode(q) cu = "%s%s" % (self._url, qs) try: if data: self.ui.debug(_("sending %s bytes\n") % headers.get('content-length',... |
mf = util.matcher("", "/", [pat], [], [])[1] | mf = util.matcher(self.root, "", [pat], [], [])[1] | def wread(self, filename): if self.encodepats == None: l = [] for pat, cmd in self.ui.configitems("encode"): mf = util.matcher("", "/", [pat], [], [])[1] l.append((mf, cmd)) self.encodepats = l |
mf = util.matcher("", "/", [pat], [], [])[1] | mf = util.matcher(self.root, "", [pat], [], [])[1] | def wwrite(self, filename, data, fd=None): if self.decodepats == None: l = [] for pat, cmd in self.ui.configitems("decode"): mf = util.matcher("", "/", [pat], [], [])[1] l.append((mf, cmd)) self.decodepats = l |
self.cdata.read(os.path.expanduser("~/.hgrc")) | self.cdata.read([os.path.normpath(hgrc) for hgrc in "/etc/mercurial/hgrc", os.path.expanduser("~/.hgrc")]) | def __init__(self, verbose=False, debug=False, quiet=False, interactive=True): self.cdata = ConfigParser.SafeConfigParser() self.cdata.read(os.path.expanduser("~/.hgrc")) |
patch.export(source, [node], fp=fp, opts=diffopts) | patch.diff(source, parents[0], node, fp=fp, opts=diffopts) | def apply(self, repo, source, revmap, merges, opts={}): '''apply the revisions in revmap one by one in revision order''' revs = revmap.keys() revs.sort() |
util.system('%s %s' % (filter, util.shellquote(patchfile)), environ={'HGUSER': changelog[1]}, onerr=util.Abort, errprefix=_('filter failed')) | user, date, msg = (changelog[1], changelog[2], changelog[4]) fd, headerfile = tempfile.mkstemp(prefix='hg-transplant-') fp = os.fdopen(fd, 'w') fp.write(" fp.write(" fp.write(" fp.write(changelog[4].rstrip()) fp.write("\n\n") fp.close() try: util.system('%s %s %s' % (filter, util.shellquote(headerfile), util.shellquo... | def filter(self, filter, changelog, patchfile): '''arbitrarily rewrite changeset before applying it''' |
self.filter(filter, cl, patchfile) patchfile, message, user, date = patch.extract(self.ui, file(patchfile)) | (user, date, message) = self.filter(filter, cl, patchfile) | def applyone(self, repo, node, cl, patchfile, merge=False, log=False, filter=None, lock=None, wlock=None): '''apply the patch in patchfile to the repository as a transplant''' (manifest, user, (time, timezone), files, message) = cl[:5] date = "%d %d" % (time, timezone) extra = {'transplant_source': node} if filter: sel... |
if filter: os.unlink(patchfile) | def applyone(self, repo, node, cl, patchfile, merge=False, log=False, filter=None, lock=None, wlock=None): '''apply the patch in patchfile to the repository as a transplant''' (manifest, user, (time, timezone), files, message) = cl[:5] date = "%d %d" % (time, timezone) extra = {'transplant_source': node} if filter: sel... | |
parents = [] message = [] for line in self.opener('journal').read().splitlines(): if line.startswith(' user = line[7:] elif line.startswith(' date = line[7:] elif line.startswith(' node = revlog.bin(line[10:]) elif line.startswith(' parents.append(revlog.bin(line[9:])) else: message.append(line) return (node, user, dat... | return self.parselog(self.opener('journal')) | def readlog(self): parents = [] message = [] for line in self.opener('journal').read().splitlines(): if line.startswith('# User '): user = line[7:] elif line.startswith('# Date '): date = line[7:] elif line.startswith('# Node ID '): node = revlog.bin(line[10:]) elif line.startswith('# Parent '): parents.append(revlog.b... |
sys.stdin = self.rfile sys.stdout = self.wfile | req = hgrequest(self.rfile, self.wfile, os.environ) | def do_hgweb(self): query = "" p = self.path.find("?") if p: query = self.path[p + 1:] query = query.replace('+', ' ') |
hg.run() | hg.run(req) | def do_hgweb(self): query = "" p = self.path.find("?") if p: query = self.path[p + 1:] query = query.replace('+', ' ') |
print line | sys.stdout.write(line) | def show_diff(expected, output): for line in difflib.unified_diff(expected, output, "Expected output", "Test output", lineterm=''): print line |
def run(cmd, split_lines=True): | def run(cmd): | def run(cmd, split_lines=True): """Run command in a sub-process, capturing the output (stdout and stderr). Return the exist code, and output.""" # TODO: Use subprocess.Popen if we're running on Python 2.4 if os.name == 'nt': tochild, fromchild = os.popen4(cmd) tochild.close() output = fromchild.read() ret = fromchild.c... |
if split_lines: output = output.splitlines() return ret, output | return ret, splitnewlines(output) | def run(cmd, split_lines=True): """Run command in a sub-process, capturing the output (stdout and stderr). Return the exist code, and output.""" # TODO: Use subprocess.Popen if we're running on Python 2.4 if os.name == 'nt': tochild, fromchild = os.popen4(cmd) tochild.close() output = fromchild.read() ret = fromchild.c... |
ref_out = f.read().splitlines() f.close() else: ref_out = '' | ref_out = splitnewlines(f.read()) f.close() else: 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... |
f = open(err, "w") | f = open(err, "wb") | 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... |
f.write("\n") | 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... | |
root_subtract_len = len(self.root) if not self.root.endswith('/'): root_subtract_len += 1 | def findfiles(s): work = [s] # self.root may end with a path separator when self.root == '/' root_subtract_len = len(self.root) if not self.root.endswith('/'): root_subtract_len += 1 while work: top = work.pop() names = os.listdir(top) names.sort() # nd is the top of the repository dir tree nd = util.normpath(top[root_... | |
nd = util.normpath(top[root_subtract_len:]) | nd = util.normpath(top[common_prefix_len:]) | def findfiles(s): work = [s] # self.root may end with a path separator when self.root == '/' root_subtract_len = len(self.root) if not self.root.endswith('/'): root_subtract_len += 1 while work: top = work.pop() names = os.listdir(top) names.sort() # nd is the top of the repository dir tree nd = util.normpath(top[root_... |
e = struct.unpack(self.format, b) self.index[i + x] = e self.map[e[-1]] = i + x | self.index[i + x] = b n = b[self.shaoffset:self.shaoffset + 20] self.map[n] = i + x | def loadblock(self, blockstart, blocksize, data=None): if self.all: return if data is None: self.dataf.seek(blockstart) data = self.dataf.read(blocksize) lend = len(data) / self.s i = blockstart / self.s off = 0 for x in xrange(lend): if self.index[i + x] == None: b = data[off : off + self.s] e = struct.unpack(self.for... |
return self.p.index[pos] or self.load(pos) | ret = self.p.index[pos] or self.load(pos) if isinstance(ret, str): ret = struct.unpack(self.p.indexformat, ret) return ret | def __getitem__(self, pos): return self.p.index[pos] or self.load(pos) |
try: yield self.p.index[i][-1] except: | ret = self.p.index[i] if not ret: | def __iter__(self): yield nullid for i in xrange(self.p.l): try: yield self.p.index[i][-1] except: self.p.loadindex(i) yield self.p.index[i][-1] |
yield self.p.index[i][-1] | ret = self.p.index[i] if isinstance(ret, str): ret = struct.unpack(self.p.indexformat, ret) yield ret[-1] | def __iter__(self): yield nullid for i in xrange(self.p.l): try: yield self.p.index[i][-1] except: self.p.loadindex(i) yield self.p.index[i][-1] |
if self.ui.verbose and 'changeset_verbose' in self.t: | if self.ui.debugflag and 'changeset_debug' in self.t: key = 'changeset_debug' elif self.ui.quiet and 'changeset_quiet' in self.t: key = 'changeset_quiet' elif self.ui.verbose and 'changeset_verbose' in self.t: | def showfiles(**args): for x in showlist('file', changes[3], **args): yield x |
if pat != "\n": p = pat[:-1] | p = pat.rstrip() if p: | def ignore(self, f): if not self.ignorefunc: bigpat = [] try: l = file(self.wjoin(".hgignore")) for pat in l: if pat != "\n": |
ui.warn(_("the --branches option is deprecated, " "please use 'hg branches' instead\n")) | def getrenamed(fn, rev, man): '''looks up all renames for a file (up to endrev) the first time the file is given. It indexes on the changerev and only parses the manifest if linkrev != changerev. Returns rename info for fn at changerev rev.''' if fn not in rcache: rcache[fn] = {} ncache[fn] = {} fl = repo.file(fn) for ... | |
yield self.diff(p1, n, file) | yield self.diff(p1, n, [file]) | def diff(**map): yield self.diff(p1, n, file) |
"forget": | "debugforget|forget": | 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... |
if ".hg" in subdirs: subdirs.remove(".hg") | if ".hg" in subdirs: subdirs.remove(".hg") for sd in subdirs: if ignore(os.path.join(d, sd + '/')): subdirs.remove(sd) | def walk(files): for f in util.unique(files): f = os.path.join(self.root, f) if os.path.isdir(f): for dir, subdirs, fl in os.walk(f): d = dir[len(self.root) + 1:] if ".hg" in subdirs: subdirs.remove(".hg") for fn in fl: fn = util.pconvert(os.path.join(d, fn)) yield fn else: yield f[len(self.root) + 1:] |
fmt = '%%s %%-%ds %%-%ds %%s\n' % ( | fmt = '%%s %%-%ds %%-%ds %%s' % ( | def debugwalk(ui, repo, *pats, **opts): """show how files match on given patterns""" items = list(walk(repo, pats, opts)) if not items: return fmt = '%%s %%-%ds %%-%ds %%s\n' % ( max([len(abs) for (src, abs, rel, exact) in items]), max([len(rel) for (src, abs, rel, exact) in items])) for src, abs, rel, exact in item... |
ui.write(fmt % (src, abs, rel, exact and 'exact' or '')) | line = fmt % (src, abs, rel, exact and 'exact' or '') ui.write("%s\n" % line.rstrip()) | def debugwalk(ui, repo, *pats, **opts): """show how files match on given patterns""" items = list(walk(repo, pats, opts)) if not items: return fmt = '%%s %%-%ds %%-%ds %%s\n' % ( max([len(abs) for (src, abs, rel, exact) in items]), max([len(rel) for (src, abs, rel, exact) in items])) for src, abs, rel, exact in item... |
norepo = ("clone init version help debugancestor debugdata" | norepo = ("clone init version help debugancestor debugcomplete debugdata" | 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... |
def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] | def findpossible(cmd): """ Return cmd -> (aliases, command table entry) for each matching command """ choice = {} debugchoice = {} | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
return aliases, table[e] | choice[cmd] = (aliases, table[e]) continue | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
debugchoice.append([aliases, table[e]]) | debugchoice[a] = (aliases, table[e]) | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
choice.append([aliases, table[e]]) | choice[a] = (aliases, table[e]) | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
clist = [] for aliases, table_e in choice: if aliases[0].startswith(cmd): clist.append(aliases[0]) for a in aliases[1:]: if a.startswith(cmd) and not aliases[0].startswith(a): clist.append(a) | clist = choice.keys() | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
return choice[0] | return choice.values()[0] | def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): if aliases[0].startswith("debug"): debugchoice.append([aliases, table[... |
wlock = self.repo.wlock() | wlock = repo.wlock() | def debugrebuildstate(ui, repo, rev=None): """rebuild the dirstate as it would look like for the given revision""" if not rev: rev = repo.changelog.tip() else: rev = repo.lookup(rev) change = repo.changelog.read(rev) n = change[0] files = repo.manifest.readflags(n) wlock = self.repo.wlock() repo.dirstate.rebuild(rev, f... |
"undo": (undo, [], _('hg undo')), | "debugundo|undo": (undo, [], _('hg undo')), | 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... |
if not commit_opts['message']: | if not commit_opts['message'] and not commit_opts['logfile']: | def backout(ui, repo, rev, **opts): '''reverse effect of earlier changeset Commit the backed out changes as a new changeset. If you back out a changeset other than the tip, a new head is created. The --merge option remembers the parent of the working directory before starting the backout, then merges the new head wi... |
'backout': | "backout": | 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... |
[('', 'message', '', _('use <text> as commit message')), ('', 'merge', None, _('merge with old dirstate parent after backout')), | [('', 'merge', None, _('merge with old dirstate parent after backout')), ('m', 'message', '', _('use <text> as commit message')), | 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 backout [OPTION]... [FILE]...')), | _('hg backout [OPTION]... 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... |
if nonexistent: | if nonexistent and type in "nm": | def changes(self, files=None, match=util.always): lookup, modified, added, unknown = [], [], [], [] removed, deleted = [], [] |
'hg clone [OPTIONS] SOURCE [DEST]'), | 'hg clone [OPTION]... SOURCE [DEST]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
'hg diff [-I] [-X] [-r REV1 [-r REV2]] [FILE]...'), | 'hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
"hg export [-o OUTFILE] REV..."), | "hg export [-a] [-o OUTFILE] REV..."), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
'hg [-b] heads'), | 'hg heads [-b]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
"hg import [-p NUM] [-b BASE] PATCH..."), | "hg import [-f] [-p NUM] [-b BASE] PATCH..."), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
'hg log [-r REV1 [-r REV2]] [-p] [FILE]'), | 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
'hg pull [OPTIONS] [SOURCE]'), | 'hg pull [-u] [-e FILE] [--remotecmd FILE] [SOURCE]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
'hg push [-f] [DEST]'), | 'hg push [-f] [-e FILE] [--remotecmd FILE] [DEST]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() |
count = 0 | def partial_name(s): count = 0 if s in self.series: return s for x in self.series: if s in x: count += 1 last = x if count > 1: return None if count: return last if len(self.series) > 0 and len(self.applied) > 0: if s == 'qtip': return self.series[self.series_end()-1] if s == 'qbase': return self.series[0] return None | |
for x in self.series: if s in x: count += 1 last = x if count > 1: return None if count: return last | matches = [x for x in self.series if s in x] if len(matches) > 1: self.ui.warn(_('patch name "%s" is ambiguous:\n') % s) for m in matches: self.ui.warn(' %s\n' % m) return None if matches: return matches[0] | def partial_name(s): count = 0 if s in self.series: return s for x in self.series: if s in x: count += 1 last = x if count > 1: return None if count: return last if len(self.series) > 0 and len(self.applied) > 0: if s == 'qtip': return self.series[self.series_end()-1] if s == 'qbase': return self.series[0] return None |
t = self.wopener(f).read() | t = self.wfile(f).read() | def commit(self, files = None, text = "", user = None, date = None): commit = [] remove = [] if files: for f in files: s = self.dirstate.state(f) if s in 'nmai': commit.append(f) elif s == 'r': remove.append(f) else: self.ui.warn("%s not tracked!\n" % f) else: (c, a, d, u) = self.diffdir(self.root) commit = c + a remov... |
u.warn(_("** report bug details to mercurial@selenic.com\n")) | u.warn(_("** report bug details to " "http://www.selenic.com/mercurial/bts\n")) u.warn(_("** or mercurial@selenic.com\n")) | 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])) |
packages=['mercurial', 'mercurial.ext'], | packages=['mercurial', 'hgext'], | def finalize_options(self): self.set_undefined_options('install', ('install_lib', 'install_dir')) install_data.finalize_options(self) |
def start(self, rev): return self.index[rev][0] def length(self, rev): return self.index[rev][1] | def start(self, rev): return (rev < 0) and -1 or self.index[rev][0] def length(self, rev): if rev < 0: return 0 else: return self.index[rev][1] | def start(self, rev): return self.index[rev][0] |
def base(self, rev): return self.index[rev][2] | def base(self, rev): return (rev < 0) and rev or self.index[rev][2] | def base(self, rev): return self.index[rev][2] |
b = self.base(r) if r == b: return self.diff(self.revision(self.node(r - 1)), self.revision(node)) else: return self.chunk(r) | return self.revdiff(r - 1, r) def revdiff(self, rev1, rev2): """return or calculate a delta between two revisions""" b1 = self.base(rev1) b2 = self.base(rev2) if b1 == b2 and rev1 + 1 == rev2: return self.chunk(rev2) else: return self.diff(self.revision(self.node(rev1)), self.revision(self.node(rev2))) | def delta(self, node): """return or calculate a delta between a node and its predecessor""" r = self.rev(node) b = self.base(r) if r == b: return self.diff(self.revision(self.node(r - 1)), self.revision(node)) else: return self.chunk(r) |
text = mdiff.patches(text, bins) | text = self.patches(text, bins) | def revision(self, node): """return an uncompressed revision of a given""" if node == nullid: return "" if self.cache and self.cache[0] == node: return self.cache[2] |
na = self.node(a) | def group(self, nodelist, lookup, infocollect=None): """calculate a delta group | |
if a + 1 != b or self.base(b) == b: ta = self.revision(na) tb = self.revision(nb) d = self.diff(ta, tb) else: d = self.chunk(b) | d = self.revdiff(a, b) | def group(self, nodelist, lookup, infocollect=None): """calculate a delta group |
c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) | if files: c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) | def prettyprintlines(diff): for l in diff.splitlines(1): if l.startswith('+'): yield self.t("difflineplus", line = l) elif l.startswith('-'): yield self.t("difflineminus", line = l) elif l.startswith('@'): yield self.t("difflineat", line = l) else: yield self.t("diffline", line = l) |
yield self.diff(p1, n, changes[3]) | yield self.diff(p1, n, None) | def diff(): yield self.diff(p1, n, changes[3]) |
if n not in m1: | if f not in m1: | 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 |
text = unicode(text, 'utf-8', 'replace') | text = unicode(text, util._encoding, 'replace') | def obfuscate(text): text = unicode(text, 'utf-8', 'replace') return ''.join(['&#%d;' % ord(c) for c in text]) |
try: user = os.environ["HGUSER"] except: user = os.environ["LOGNAME"] + '@' + socket.getfqdn() | user = (os.environ.get("HGUSER") or os.environ.get("EMAIL") or os.environ.get("LOGNAME", "unknown") + '@' + socket.getfqdn()) | def add(self, manifest, list, desc, transaction, p1=None, p2=None): try: user = os.environ["HGUSER"] except: user = os.environ["LOGNAME"] + '@' + socket.getfqdn() date = "%d %d" % (time.time(), time.timezone) list.sort() l = [hex(manifest), user, date] + list + ["", desc] text = "\n".join(l) return self.addrevision(tex... |
"debugdate": (debugdate, [('e','extended', None, _('try extended date formats'))], _('debugdata [-e] DATE [RANGE]')), | "debugdate": (debugdate, [('e', 'extended', None, _('try extended date formats'))], _('debugdate [-e] DATE [RANGE]')), | def version_(ui): """output version and copyright information""" ui.write(_("Mercurial Distributed SCM (version %s)\n") % version.get_version()) ui.status(_( "\nCopyright (C) 2005, 2006 Matt Mackall <mpm@selenic.com>\n" "This is free software; see the source for copying conditions. " "There is NO\nwarranty; " "not even... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.