# HG changeset patch # User Thomas Arendsen Hein # Date 1339077312 -7200 # Node ID d628bcb3a567a4018fc9855876f5c020b0493648 # Parent 4fd1f1d7569bceef4cbb98603f4968bb36ccb289# Parent 5e3a1b96dbb0fc502f5c4fb6c3baf81da710e1f0 merge heads diff -r 5e3a1b96dbb0 -r d628bcb3a567 contrib/perf.py --- a/contrib/perf.py Mon Jun 04 14:46:42 2012 -0700 +++ b/contrib/perf.py Thu Jun 07 15:55:12 2012 +0200 @@ -74,7 +74,7 @@ def perfancestors(ui, repo): heads = repo.changelog.headrevs() def d(): - for a in repo.changelog.ancestors(*heads): + for a in repo.changelog.ancestors(heads): pass timer(d) @@ -140,6 +140,10 @@ def perflookup(ui, repo, rev): timer(lambda: len(repo.lookup(rev))) +def perfrevrange(ui, repo, *specs): + revrange = scmutil.revrange + timer(lambda: len(revrange(repo, specs))) + def perfnodelookup(ui, repo, rev): import mercurial.revlog mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg @@ -223,6 +227,7 @@ 'perffncacheload': (perffncacheload, []), 'perffncachewrite': (perffncachewrite, []), 'perflookup': (perflookup, []), + 'perfrevrange': (perfrevrange, []), 'perfnodelookup': (perfnodelookup, []), 'perfparents': (perfparents, []), 'perfstartup': (perfstartup, []), diff -r 5e3a1b96dbb0 -r d628bcb3a567 hgext/bugzilla.py --- a/hgext/bugzilla.py Mon Jun 04 14:46:42 2012 -0700 +++ b/hgext/bugzilla.py Thu Jun 07 15:55:12 2012 +0200 @@ -657,8 +657,9 @@ if self.bzvermajor >= 4: args['ids'] = [bugid] args['comment'] = {'body' : text} - args['status'] = self.fixstatus - args['resolution'] = self.fixresolution + if 'fix' in newstate: + args['status'] = self.fixstatus + args['resolution'] = self.fixresolution self.bzproxy.Bug.update(args) else: if 'fix' in newstate: diff -r 5e3a1b96dbb0 -r d628bcb3a567 hgext/convert/hg.py --- a/hgext/convert/hg.py Mon Jun 04 14:46:42 2012 -0700 +++ b/hgext/convert/hg.py Thu Jun 07 15:55:12 2012 +0200 @@ -259,7 +259,7 @@ % startnode) startrev = self.repo.changelog.rev(startnode) children = {startnode: 1} - for rev in self.repo.changelog.descendants(startrev): + for rev in self.repo.changelog.descendants([startrev]): children[self.repo.changelog.node(rev)] = 1 self.keep = children.__contains__ else: diff -r 5e3a1b96dbb0 -r d628bcb3a567 hgext/mq.py --- a/hgext/mq.py Mon Jun 04 14:46:42 2012 -0700 +++ b/hgext/mq.py Thu Jun 07 15:55:12 2012 +0200 @@ -2963,7 +2963,7 @@ if not revs: raise util.Abort(_('empty revision set')) - descendants = set(cl.descendants(*revs)) + descendants = set(cl.descendants(revs)) strippedrevs = revs.union(descendants) roots = revs.difference(descendants) diff -r 5e3a1b96dbb0 -r d628bcb3a567 hgext/rebase.py --- a/hgext/rebase.py Mon Jun 04 14:46:42 2012 -0700 +++ b/hgext/rebase.py Thu Jun 07 15:55:12 2012 +0200 @@ -224,7 +224,7 @@ else: originalwd, target, state = result if collapsef: - targetancestors = set(repo.changelog.ancestors(target)) + targetancestors = set(repo.changelog.ancestors([target])) targetancestors.add(target) external = checkexternal(repo, state, targetancestors) @@ -243,7 +243,7 @@ # Rebase if not targetancestors: - targetancestors = set(repo.changelog.ancestors(target)) + targetancestors = set(repo.changelog.ancestors([target])) targetancestors.add(target) # Keep track of the current bookmarks in order to reset them later @@ -321,7 +321,7 @@ # Remove no more useful revisions rebased = [rev for rev in state if state[rev] != nullmerge] if rebased: - if set(repo.changelog.descendants(min(rebased))) - set(state): + if set(repo.changelog.descendants([min(rebased)])) - set(state): ui.warn(_("warning: new changesets detected " "on source branch, not stripping\n")) else: @@ -575,7 +575,7 @@ descendants = set() if dstates: - descendants = set(repo.changelog.descendants(*dstates)) + descendants = set(repo.changelog.descendants(dstates)) if descendants - set(dstates): repo.ui.warn(_("warning: new changesets detected on target branch, " "can't abort\n")) diff -r 5e3a1b96dbb0 -r d628bcb3a567 i18n/ru.po --- a/i18n/ru.po Mon Jun 04 14:46:42 2012 -0700 +++ b/i18n/ru.po Thu Jun 07 15:55:12 2012 +0200 @@ -172,7 +172,7 @@ msgstr "" "Project-Id-Version: Mercurial\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-05-27 18:16+0400\n" +"POT-Creation-Date: 2012-06-05 10:52+0400\n" "PO-Revision-Date: 2011-05-12 23:48+0400\n" "Last-Translator: Alexander Sauta \n" "Language-Team: Russian\n" @@ -22620,6 +22620,9 @@ msgid "could not symlink to %r: %s" msgstr "не удается создать символическую ссылку на %r: %s" +msgid "empty revision range" +msgstr "пустой диапазон ревизий" + #, python-format msgid "recording removal of %s as rename to %s (%d%% similar)\n" msgstr "удаление %s записывается как переименование в %s (похожесть %d%%)\n" diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/base85.c --- a/mercurial/base85.c Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/base85.c Thu Jun 07 15:55:12 2012 +0200 @@ -111,7 +111,8 @@ if (c < 0) return PyErr_Format( PyExc_ValueError, - "bad base85 character at position %d", i); + "bad base85 character at position %d", + (int)i); acc = acc * 85 + c; } if (i++ < len) @@ -120,13 +121,15 @@ if (c < 0) return PyErr_Format( PyExc_ValueError, - "bad base85 character at position %d", i); + "bad base85 character at position %d", + (int)i); /* overflow detection: 0xffffffff == "|NsC0", * "|NsC" == 0x03030303 */ if (acc > 0x03030303 || (acc *= 85) > 0xffffffff - c) return PyErr_Format( PyExc_ValueError, - "bad base85 sequence at position %d", i); + "bad base85 sequence at position %d", + (int)i); acc += c; } diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/commands.py --- a/mercurial/commands.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/commands.py Thu Jun 07 15:55:12 2012 +0200 @@ -2744,7 +2744,7 @@ stats = mergemod.update(repo, ctx.node(), True, True, False, ctx.p1().node()) finally: - ui.setconfig('ui', 'forcemerge', '') + repo.ui.setconfig('ui', 'forcemerge', '') # drop the second merge parent repo.setparents(current.node(), nullid) repo.dirstate.write() @@ -3004,7 +3004,7 @@ ('a', 'active', False, _('show active branchheads only (DEPRECATED)')), ('c', 'closed', False, _('show normal and closed branch heads')), ] + templateopts, - _('[-ac] [-r STARTREV] [REV]...')) + _('[-ct] [-r STARTREV] [REV]...')) def heads(ui, repo, *branchrevs, **opts): """show current repository heads or show branch heads @@ -3097,16 +3097,18 @@ # except block, nor can be used inside a lambda. python issue4617 prefix = inst.args[0] select = lambda c: c.lstrip('^').startswith(prefix) - helplist(select) - return + rst = helplist(select) + return rst + + rst = [] # check if it's an invalid alias and display its error if it is if getattr(entry[0], 'badalias', False): if not unknowncmd: + ui.pushbuffer() entry[0](ui) - return - - rst = [] + rst.append(ui.popbuffer()) + return rst # synopsis if len(entry) > 2: @@ -3165,10 +3167,7 @@ elif not ui.quiet: rst.append(_('\nuse "hg -v help %s" to show more info\n') % name) - - keep = ui.verbose and ['verbose'] or [] - formatted, pruned = minirst.format(''.join(rst), textwidth, keep=keep) - ui.write(formatted) + return rst def helplist(select=None): @@ -3201,34 +3200,34 @@ h[f] = doc.splitlines()[0].rstrip() cmds[f] = c.lstrip("^") + rst = [] if not h: - ui.status(_('no commands defined\n')) - return - - ui.status(header) + if not ui.quiet: + rst.append(_('no commands defined\n')) + return rst + + if not ui.quiet: + rst.append(header) fns = sorted(h) - m = max(map(len, fns)) for f in fns: if ui.verbose: commands = cmds[f].replace("|",", ") - ui.write(" %s:\n %s\n"%(commands, h[f])) + rst.append(" :%s: %s\n" % (commands, h[f])) else: - ui.write('%s\n' % (util.wrap(h[f], textwidth, - initindent=' %-*s ' % (m, f), - hangindent=' ' * (m + 4)))) + rst.append(' :%s: %s\n' % (f, h[f])) if not name: - text = help.listexts(_('enabled extensions:'), extensions.enabled()) - if text: - ui.write("\n%s" % minirst.format(text, textwidth)) - - ui.write(_("\nadditional help topics:\n\n")) + exts = help.listexts(_('enabled extensions:'), extensions.enabled()) + if exts: + rst.append('\n') + rst.extend(exts) + + rst.append(_("\nadditional help topics:\n\n")) topics = [] for names, header, doc in help.helptable: topics.append((sorted(names, key=len, reverse=True)[0], header)) - topics_len = max([len(s[0]) for s in topics]) for t, desc in topics: - ui.write(" %-*s %s\n" % (topics_len, t, desc)) + rst.append(" :%s: %s\n" % (t, desc)) optlist = [] if not ui.quiet: @@ -3249,17 +3248,12 @@ 'global options') % (name and " " + name or "") optlist.append((msg, ())) - if not optlist: - return - - rst = '' - for title, options in optlist: - rst += '\n%s\n' % title - if options: - rst += "\n" - rst += help.optrst(options, ui.verbose) - rst += '\n' - ui.write('\n' + minirst.format(rst, textwidth)) + if optlist: + for title, options in optlist: + rst.append('\n%s\n' % title) + if options: + rst.append('\n%s\n' % help.optrst(options, ui.verbose)) + return rst def helptopic(name): for names, header, doc in help.helptable: @@ -3281,7 +3275,7 @@ 'the %s command\n') % (name, name)) except error.UnknownCommand: pass - ui.write(minirst.format(''.join(rst), textwidth)) + return rst def helpext(name): try: @@ -3297,10 +3291,10 @@ head, tail = doc, "" else: head, tail = doc.split('\n', 1) - ui.write(_('%s extension - %s\n\n') % (name.split('.')[-1], head)) + rst = [_('%s extension - %s\n\n') % (name.split('.')[-1], head)] if tail: - ui.write(minirst.format(tail, textwidth)) - ui.status('\n') + rst.extend(tail.splitlines(True)) + rst.append('\n') if mod: try: @@ -3308,23 +3302,26 @@ except AttributeError: ct = {} modcmds = set([c.split('|', 1)[0] for c in ct]) - helplist(modcmds.__contains__) + rst.extend(helplist(modcmds.__contains__)) else: - ui.write(_('use "hg help extensions" for information on enabling ' + rst.append(_('use "hg help extensions" for information on enabling ' 'extensions\n')) + return rst def helpextcmd(name): cmd, ext, mod = extensions.disabledcmd(ui, name, ui.configbool('ui', 'strict')) doc = gettext(mod.__doc__).splitlines()[0] - msg = help.listexts(_("'%s' is provided by the following " + rst = help.listexts(_("'%s' is provided by the following " "extension:") % cmd, {ext: doc}, indent=4) - ui.write(minirst.format(msg, textwidth)) - ui.write('\n') - ui.write(_('use "hg help extensions" for information on enabling ' + rst.append('\n') + rst.append(_('use "hg help extensions" for information on enabling ' 'extensions\n')) - + return rst + + + rst = [] kw = opts.get('keyword') if kw: matches = help.topicmatch(kw) @@ -3333,12 +3330,10 @@ ('extensions', _('Extensions')), ('extensioncommands', _('Extension Commands'))): if matches[t]: - ui.write('%s:\n\n' % title) - rst = ''.join(minirst.maketable(matches[t], 1)) - ui.write(minirst.format(rst)) - return - - if name and name != 'shortlist': + rst.append('%s:\n\n' % title) + rst.extend(minirst.maketable(matches[t], 1)) + rst.append('\n') + elif name and name != 'shortlist': i = None if unknowncmd: queries = (helpextcmd,) @@ -3350,7 +3345,7 @@ queries = (helptopic, helpcmd, helpext, helpextcmd) for f in queries: try: - f(name) + rst = f(name) i = None break except error.UnknownCommand, inst: @@ -3359,9 +3354,13 @@ raise i else: # program name - ui.status(_("Mercurial Distributed SCM\n")) - ui.status('\n') - helplist() + if not ui.quiet: + rst = [_("Mercurial Distributed SCM\n"), '\n'] + rst.extend(helplist()) + + keep = ui.verbose and ['verbose'] or [] + formatted, pruned = minirst.format(''.join(rst), textwidth, keep=keep) + ui.write(formatted) @command('identify|id', @@ -5398,12 +5397,12 @@ cl = repo.changelog for a in [cl.rev(n) for n in bheads]: new[a] = 1 - for a in cl.ancestors(*[cl.rev(n) for n in bheads]): + for a in cl.ancestors([cl.rev(n) for n in bheads]): new[a] = 1 for a in [p.rev() for p in parents]: if a >= 0: new[a] = 0 - for a in cl.ancestors(*[p.rev() for p in parents]): + for a in cl.ancestors([p.rev() for p in parents]): new[a] = 0 new = sum(new) @@ -5658,10 +5657,10 @@ current named branch and move the current bookmark (see :hg:`help bookmarks`). - If the changeset is not a descendant of the working directory's - parent, the update is aborted. With the -c/--check option, the - working directory is checked for uncommitted changes; if none are - found, the working directory is updated to the specified + If the changeset is not a descendant or ancestor of the working + directory's parent, the update is aborted. With the -c/--check + option, the working directory is checked for uncommitted changes; if + none are found, the working directory is updated to the specified changeset. Update sets the working directory's parent revison to the specified diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/config.py --- a/mercurial/config.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/config.py Thu Jun 07 15:55:12 2012 +0200 @@ -35,6 +35,10 @@ def __delitem__(self, key): dict.__delitem__(self, key) self._list.remove(key) + def keys(self): + return self._list + def iterkeys(self): + return self._list.__iter__() class config(object): def __init__(self, data=None): diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/context.py --- a/mercurial/context.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/context.py Thu Jun 07 15:55:12 2012 +0200 @@ -223,11 +223,11 @@ return [changectx(self._repo, x) for x in c] def ancestors(self): - for a in self._repo.changelog.ancestors(self._rev): + for a in self._repo.changelog.ancestors([self._rev]): yield changectx(self._repo, a) def descendants(self): - for d in self._repo.changelog.descendants(self._rev): + for d in self._repo.changelog.descendants([self._rev]): yield changectx(self._repo, d) def _fileinfo(self, path): @@ -1019,7 +1019,7 @@ def ancestors(self): for a in self._repo.changelog.ancestors( - *[p.rev() for p in self._parents]): + [p.rev() for p in self._parents]): yield changectx(self._repo, a) def undelete(self, list): diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/discovery.py --- a/mercurial/discovery.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/discovery.py Thu Jun 07 15:55:12 2012 +0200 @@ -140,7 +140,7 @@ og._computecommonmissing() cl = repo.changelog missingrevs = set(cl.rev(n) for n in og._missing) - og._common = set(cl.ancestors(*missingrevs)) - missingrevs + og._common = set(cl.ancestors(missingrevs)) - missingrevs commonheads = set(og.commonheads) og.missingheads = [h for h in og.missingheads if h not in commonheads] diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/help.py --- a/mercurial/help.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/help.py Thu Jun 07 15:55:12 2012 +0200 @@ -12,19 +12,18 @@ def listexts(header, exts, indent=1): '''return a text listing of the given extensions''' - if not exts: - return '' - maxlength = max(len(e) for e in exts) - result = '\n%s\n\n' % header - for name, desc in sorted(exts.iteritems()): - result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2, - ':%s:' % name, desc) - return result + rst = [] + if exts: + rst.append('\n%s\n\n' % header) + for name, desc in sorted(exts.iteritems()): + rst.append('%s:%s: %s\n' % (' ' * indent, name, desc)) + return rst def extshelp(): - doc = loaddoc('extensions')() - doc += listexts(_('enabled extensions:'), extensions.enabled()) - doc += listexts(_('disabled extensions:'), extensions.disabled()) + rst = loaddoc('extensions')().splitlines(True) + rst.extend(listexts(_('enabled extensions:'), extensions.enabled())) + rst.extend(listexts(_('disabled extensions:'), extensions.disabled())) + doc = ''.join(rst) return doc def optrst(options, verbose): @@ -70,7 +69,7 @@ """ kw = encoding.lower(kw) def lowercontains(container): - return kw in encoding.lower(_(container)) + return kw in encoding.lower(container) # translated in helptable results = {'topics': [], 'commands': [], 'extensions': [], @@ -89,9 +88,10 @@ summary = entry[2] else: summary = '' - docs = getattr(entry[0], '__doc__', None) or '' + # translate docs *before* searching there + docs = _(getattr(entry[0], '__doc__', None)) or '' if kw in cmd or lowercontains(summary) or lowercontains(docs): - doclines = _(docs).splitlines() + doclines = docs.splitlines() if doclines: summary = doclines[0] cmdname = cmd.split('|')[0].lstrip('^') @@ -102,12 +102,16 @@ # extensions.load ignores the UI argument mod = extensions.load(None, name, '') if lowercontains(name) or lowercontains(docs): - results['extensions'].append((name, _(docs).splitlines()[0])) + # extension docs are already translated + results['extensions'].append((name, docs.splitlines()[0])) for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): cmdname = cmd.split('|')[0].lstrip('^') - results['extensioncommands'].append( - (cmdname, _(getattr(cmd, '__doc__', '')))) + if mod.__doc__: + cmddoc = gettext(mod.__doc__).splitlines()[0] + else: + cmddoc = _('(no help text available)') + results['extensioncommands'].append((cmdname, cmddoc)) return results def loaddoc(topic): diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/localrepo.py Thu Jun 07 15:55:12 2012 +0200 @@ -1791,7 +1791,7 @@ bases = [nullid] csets, bases, heads = cl.nodesbetween(bases, heads) # We assume that all ancestors of bases are known - common = set(cl.ancestors(*[cl.rev(n) for n in bases])) + common = set(cl.ancestors([cl.rev(n) for n in bases])) return self._changegroupsubset(common, csets, heads, source) def getlocalbundle(self, source, outgoing): diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/parsers.c --- a/mercurial/parsers.c Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/parsers.c Thu Jun 07 15:55:12 2012 +0200 @@ -276,6 +276,9 @@ static char *tuple_format = "kiiiiiis#"; #endif +/* A RevlogNG v1 index entry is 64 bytes long. */ +static const long v1_hdrsize = 64; + /* * Return a pointer to the beginning of a RevlogNG record. */ @@ -292,7 +295,7 @@ return self->offsets[pos]; } - return PyString_AS_STRING(self->data) + pos * 64; + return PyString_AS_STRING(self->data) + pos * v1_hdrsize; } /* @@ -1137,17 +1140,16 @@ { const char *data = PyString_AS_STRING(self->data); const char *end = data + PyString_GET_SIZE(self->data); - const long hdrsize = 64; - long incr = hdrsize; + long incr = v1_hdrsize; Py_ssize_t len = 0; - while (data + hdrsize <= end) { + while (data + v1_hdrsize <= end) { uint32_t comp_len; const char *old_data; /* 3rd element of header is length of compressed inline data */ comp_len = getbe32(data + 8); - incr = hdrsize + comp_len; - if (incr < hdrsize) + incr = v1_hdrsize + comp_len; + if (incr < v1_hdrsize) break; if (offsets) offsets[len] = data; @@ -1158,7 +1160,7 @@ break; } - if (data != end && data + hdrsize != end) { + if (data != end && data + v1_hdrsize != end) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_ValueError, "corrupt index file"); return -1; @@ -1201,11 +1203,11 @@ self->raw_length = len; self->length = len + 1; } else { - if (size % 64) { + if (size % v1_hdrsize) { PyErr_SetString(PyExc_ValueError, "corrupt index file"); goto bail; } - self->raw_length = size / 64; + self->raw_length = size / v1_hdrsize; self->length = self->raw_length + 1; } diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/phases.py --- a/mercurial/phases.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/phases.py Thu Jun 07 15:55:12 2012 +0200 @@ -189,7 +189,7 @@ if roots: for rev in roots: revs[rev] = phase - for rev in repo.changelog.descendants(*roots): + for rev in repo.changelog.descendants(roots): revs[rev] = phase self._phaserevs = revs return self._phaserevs diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/repair.py --- a/mercurial/repair.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/repair.py Thu Jun 07 15:55:12 2012 +0200 @@ -74,7 +74,7 @@ # base = revision in the set that has no ancestor in the set) tostrip = set(striplist) for rev in striplist: - for desc in cl.descendants(rev): + for desc in cl.descendants([rev]): tostrip.add(desc) files = _collectfiles(repo, striprev) @@ -91,7 +91,7 @@ # compute base nodes if saverevs: - descendants = set(cl.descendants(*saverevs)) + descendants = set(cl.descendants(saverevs)) saverevs.difference_update(descendants) savebases = [cl.node(r) for r in saverevs] stripbases = [cl.node(r) for r in tostrip] diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/revlog.py --- a/mercurial/revlog.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/revlog.py Thu Jun 07 15:55:12 2012 +0200 @@ -384,8 +384,9 @@ visit.append(p) return reachable - def ancestors(self, *revs): + def ancestors(self, revs, stoprev=0): """Generate the ancestors of 'revs' in reverse topological order. + Does not generate revs lower than stoprev. Yield a sequence of revision numbers starting with the parents of each revision in revs, i.e., each revision is *not* considered @@ -396,12 +397,14 @@ seen = set([nullrev]) while visit: for parent in self.parentrevs(visit.popleft()): + if parent < stoprev: + continue if parent not in seen: visit.append(parent) seen.add(parent) yield parent - def descendants(self, *revs): + def descendants(self, revs): """Generate the descendants of 'revs' in revision order. Yield a sequence of revision numbers starting with a child of @@ -444,7 +447,7 @@ heads = [self.rev(n) for n in heads] # we want the ancestors, but inclusive - has = set(self.ancestors(*common)) + has = set(self.ancestors(common)) has.add(nullrev) has.update(common) @@ -703,7 +706,7 @@ def descendant(self, start, end): if start == nullrev: return True - for i in self.descendants(start): + for i in self.descendants([start]): if i == end: return True elif i > end: diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/revset.py --- a/mercurial/revset.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/revset.py Thu Jun 07 15:55:12 2012 +0200 @@ -47,6 +47,36 @@ yield i break +def _revsbetween(repo, roots, heads): + """Return all paths between roots and heads, inclusive of both endpoint + sets.""" + if not roots: + return [] + parentrevs = repo.changelog.parentrevs + visit = heads[:] + reachable = set() + seen = {} + minroot = min(roots) + roots = set(roots) + # open-code the post-order traversal due to the tiny size of + # sys.getrecursionlimit() + while visit: + rev = visit.pop() + if rev in roots: + reachable.add(rev) + parents = parentrevs(rev) + seen[rev] = parents + for parent in parents: + if parent >= minroot and parent not in seen: + visit.append(parent) + if not reachable: + return [] + for rev in sorted(seen): + for parent in seen[rev]: + if parent in reachable: + reachable.add(rev) + return sorted(reachable) + elements = { "(": (20, ("group", 1, ")"), ("func", 1, ")")), "~": (18, None, ("ancestor", 18)), @@ -191,6 +221,14 @@ s = set(subset) return [x for x in r if x in s] +def dagrange(repo, subset, x, y): + if subset: + r = range(len(repo)) + xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y)) + s = set(subset) + return [r for r in xs if r in s] + return [] + def andset(repo, subset, x, y): return getset(repo, getset(repo, subset, x), y) @@ -1309,6 +1347,7 @@ methods = { "range": rangeset, + "dagrange": dagrange, "string": stringset, "symbol": symbolset, "and": andset, @@ -1332,9 +1371,6 @@ op = x[0] if op == 'minus': return optimize(('and', x[1], ('not', x[2])), small) - elif op == 'dagrange': - return optimize(('and', ('func', ('symbol', 'descendants'), x[1]), - ('func', ('symbol', 'ancestors'), x[2])), small) elif op == 'dagrangepre': return optimize(('func', ('symbol', 'ancestors'), x[1]), small) elif op == 'dagrangepost': @@ -1348,7 +1384,7 @@ '-' + getstring(x[1], _("can't negate that"))), small) elif op in 'string symbol negate': return smallbonus, x # single revisions are small - elif op == 'and' or op == 'dagrange': + elif op == 'and': wa, ta = optimize(x[1], True) wb, tb = optimize(x[2], True) w = min(wa, wb) @@ -1369,7 +1405,7 @@ return o[0], (op, o[1]) elif op == 'group': return optimize(x[1], small) - elif op in 'range list parent ancestorspec': + elif op in 'dagrange range list parent ancestorspec': if op == 'parent': # x^:y means (x^) : y, not x ^ (:y) post = ('parentpost', x[1]) diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/templates/gitweb/filediff.tmpl --- a/mercurial/templates/gitweb/filediff.tmpl Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/templates/gitweb/filediff.tmpl Thu Jun 07 15:55:12 2012 +0200 @@ -26,8 +26,9 @@ revisions | annotate | diff | -raw
| +raw | help +
{file|escape}
diff -r 5e3a1b96dbb0 -r d628bcb3a567 mercurial/util.py --- a/mercurial/util.py Mon Jun 04 14:46:42 2012 -0700 +++ b/mercurial/util.py Thu Jun 07 15:55:12 2012 +0200 @@ -870,14 +870,14 @@ else: yield chunk self.iter = splitbig(in_iter) - self._queue = [] + self._queue = deque() def read(self, l): """Read L bytes of data from the iterator of chunks of data. Returns less than L bytes if the iterator runs dry.""" left = l buf = '' - queue = deque(self._queue) + queue = self._queue while left > 0: # refill the queue if not queue: @@ -897,7 +897,6 @@ buf += chunk[:left] else: buf += chunk - self._queue = list(queue) return buf diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/hghave --- a/tests/hghave Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/hghave Thu Jun 07 15:55:12 2012 +0200 @@ -202,7 +202,7 @@ os.rmdir(d) def has_pyflakes(): - return matchoutput('echo "import re" 2>&1 | pyflakes', + return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"", r":1: 're' imported but unused", True) diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-add.t --- a/tests/test-add.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-add.t Thu Jun 07 15:55:12 2012 +0200 @@ -1,5 +1,3 @@ - $ "$TESTDIR/hghave" no-windows || exit 80 - $ hg init a $ cd a $ echo a > a @@ -35,6 +33,7 @@ A a A b +#if no-windows $ echo foo > con.xml $ hg --config ui.portablefilenames=jump add con.xml abort: ui.portablefilenames value is invalid ('jump') @@ -69,6 +68,7 @@ A b A con.xml A hello:world +#endif $ hg ci -m 0 --traceback diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-addremove.t --- a/tests/test-addremove.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-addremove.t Thu Jun 07 15:55:12 2012 +0200 @@ -1,5 +1,3 @@ - $ "$TESTDIR/hghave" no-windows || exit 80 - $ hg init rep $ cd rep $ mkdir dir @@ -12,17 +10,14 @@ foo committed changeset 0:6f7f953567a2 $ cd dir/ - $ touch ../foo_2 bar_2 con.xml + $ touch ../foo_2 bar_2 $ hg -v addremove adding dir/bar_2 - adding dir/con.xml adding foo_2 - warning: filename contains 'con', which is reserved on Windows: 'dir/con.xml' $ hg -v commit -m "add 2" dir/bar_2 - dir/con.xml foo_2 - committed changeset 1:6bb597da00f1 + committed changeset 1:e65414bf35c5 $ cd .. $ hg init sim diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-alias.t --- a/tests/test-alias.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-alias.t Thu Jun 07 15:55:12 2012 +0200 @@ -340,24 +340,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] @@ -367,24 +367,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] @@ -394,24 +394,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-clone-failure.t --- a/tests/test-clone-failure.t Mon Jun 04 14:46:42 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ - $ "$TESTDIR/hghave" unix-permissions || exit 80 - -No local source - - $ hg clone a b - abort: repository a not found! - [255] - -No remote source - - $ hg clone http://127.0.0.1:3121/a b - abort: error: Connection refused - [255] - $ rm -rf b # work around bug with http clone - -Inaccessible source - - $ mkdir a - $ chmod 000 a - $ hg clone a b - abort: repository a not found! - [255] - -Inaccessible destination - - $ hg init b - $ cd b - $ hg clone . ../a - abort: Permission denied: ../a - [255] - $ cd .. - $ chmod 700 a - $ rm -r a b - -Source of wrong type - - $ if "$TESTDIR/hghave" -q fifo; then - > mkfifo a - > hg clone a b - > rm a - > else - > echo "abort: repository a not found!" - > fi - abort: repository a not found! - -Default destination, same directory - - $ hg init q - $ hg clone q - destination directory: q - abort: destination 'q' is not empty - [255] - -destination directory not empty - - $ mkdir a - $ echo stuff > a/a - $ hg clone q a - abort: destination 'a' is not empty - [255] - -leave existing directory in place after clone failure - - $ hg init c - $ cd c - $ echo c > c - $ hg commit -A -m test - adding c - $ chmod -rx .hg/store/data - $ cd .. - $ mkdir d - $ hg clone c d 2> err - [255] - $ test -d d - $ test -d d/.hg - [1] - -reenable perm to allow deletion - - $ chmod +rx c/.hg/store/data diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-clone.t --- a/tests/test-clone.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-clone.t Thu Jun 07 15:55:12 2012 +0200 @@ -458,3 +458,101 @@ updating to branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -r ua + + +Testing failures: + + $ mkdir fail + $ cd fail + +No local source + + $ hg clone a b + abort: repository a not found! + [255] + +No remote source + + $ hg clone http://127.0.0.1:3121/a b + abort: error: *refused* (glob) + [255] + $ rm -rf b # work around bug with http clone + + +#if unix-permissions + +Inaccessible source + + $ mkdir a + $ chmod 000 a + $ hg clone a b + abort: repository a not found! + [255] + +Inaccessible destination + + $ hg init b + $ cd b + $ hg clone . ../a + abort: Permission denied: ../a + [255] + $ cd .. + $ chmod 700 a + $ rm -r a b + +#endif + + +Source of wrong type + + $ if "$TESTDIR/hghave" -q fifo; then + > mkfifo a + > hg clone a b + > rm a + > else + > echo "abort: repository a not found!" + > fi + abort: repository a not found! + +Default destination, same directory + + $ hg init q + $ hg clone q + destination directory: q + abort: destination 'q' is not empty + [255] + +destination directory not empty + + $ mkdir a + $ echo stuff > a/a + $ hg clone q a + abort: destination 'a' is not empty + [255] + + +#if unix-permissions + +leave existing directory in place after clone failure + + $ hg init c + $ cd c + $ echo c > c + $ hg commit -A -m test + adding c + $ chmod -rx .hg/store/data + $ cd .. + $ mkdir d + $ hg clone c d 2> err + [255] + $ test -d d + $ test -d d/.hg + [1] + +reenable perm to allow deletion + + $ chmod +rx c/.hg/store/data + +#endif + + $ cd .. diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-commandserver.py.out --- a/tests/test-commandserver.py.out Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-commandserver.py.out Thu Jun 07 15:55:12 2012 +0200 @@ -16,24 +16,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details runcommand id --quiet diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-commit-copy.t --- a/tests/test-commit-copy.t Mon Jun 04 14:46:42 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - $ hg init dir - $ cd dir - $ echo bleh > bar - $ hg add bar - $ hg ci -m 'add bar' - - $ hg cp bar foo - $ echo >> bar - $ hg ci -m 'cp bar foo; change bar' - - $ hg debugrename foo - foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9 - $ hg debugindex bar - rev offset length base linkrev nodeid p1 p2 - 0 0 6 0 0 26d3ca0dfd18 000000000000 000000000000 - 1 6 7 1 1 d267bddd54f7 26d3ca0dfd18 000000000000 diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-commit.t --- a/tests/test-commit.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-commit.t Thu Jun 07 15:55:12 2012 +0200 @@ -283,3 +283,24 @@ HG: removed removed abort: empty commit message [255] + $ cd .. + + +commit copy + + $ hg init dir2 + $ cd dir2 + $ echo bleh > bar + $ hg add bar + $ hg ci -m 'add bar' + + $ hg cp bar foo + $ echo >> bar + $ hg ci -m 'cp bar foo; change bar' + + $ hg debugrename foo + foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9 + $ hg debugindex bar + rev offset length base linkrev nodeid p1 p2 + 0 0 6 0 0 26d3ca0dfd18 000000000000 000000000000 + 1 6 7 1 1 d267bddd54f7 26d3ca0dfd18 000000000000 diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-copy.t --- a/tests/test-copy.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-copy.t Thu Jun 07 15:55:12 2012 +0200 @@ -1,3 +1,7 @@ + + $ mkdir part1 + $ cd part1 + $ hg init $ echo a > a $ hg add a @@ -92,3 +96,119 @@ crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions + + $ cd .. + + + $ mkdir part2 + $ cd part2 + + $ hg init + $ echo foo > foo +should fail - foo is not managed + $ hg mv foo bar + foo: not copying - file is not managed + abort: no files to copy + [255] + $ hg st -A + ? foo + $ hg add foo +dry-run; print a warning that this is not a real copy; foo is added + $ hg mv --dry-run foo bar + foo has not been committed yet, so no copy data will be stored for bar. + $ hg st -A + A foo +should print a warning that this is not a real copy; bar is added + $ hg mv foo bar + foo has not been committed yet, so no copy data will be stored for bar. + $ hg st -A + A bar +should print a warning that this is not a real copy; foo is added + $ hg cp bar foo + bar has not been committed yet, so no copy data will be stored for foo. + $ hg rm -f bar + $ rm bar + $ hg st -A + A foo + $ hg commit -m1 + +moving a missing file + $ rm foo + $ hg mv foo foo3 + foo: deleted in working copy + foo3 does not exist! + $ hg up -qC . + +copy --after to a nonexistant target filename + $ hg cp -A foo dummy + foo: not recording copy - dummy does not exist + +dry-run; should show that foo is clean + $ hg copy --dry-run foo bar + $ hg st -A + C foo +should show copy + $ hg copy foo bar + $ hg st -C + A bar + foo + +shouldn't show copy + $ hg commit -m2 + $ hg st -C + +should match + $ hg debugindex foo + rev offset length base linkrev nodeid p1 p2 + 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000 + $ hg debugrename bar + bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd + + $ echo bleah > foo + $ echo quux > bar + $ hg commit -m3 + +should not be renamed + $ hg debugrename bar + bar not renamed + + $ hg copy -f foo bar +should show copy + $ hg st -C + M bar + foo + $ hg commit -m3 + +should show no parents for tip + $ hg debugindex bar + rev offset length base linkrev nodeid p1 p2 + 0 0 69 0 1 7711d36246cc 000000000000 000000000000 + 1 69 6 1 2 bdf70a2b8d03 7711d36246cc 000000000000 + 2 75 81 1 3 b2558327ea8d 000000000000 000000000000 +should match + $ hg debugindex foo + rev offset length base linkrev nodeid p1 p2 + 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000 + 1 5 7 1 2 dd12c926cf16 2ed2a3912a0b 000000000000 + $ hg debugrename bar + bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17 + +should show no copies + $ hg st -C + +copy --after on an added file + $ cp bar baz + $ hg add baz + $ hg cp -A bar baz + $ hg st -C + A baz + bar + +foo was clean: + $ hg st -AC foo + C foo +but it's considered modified after a copy --after --force + $ hg copy -Af bar foo + $ hg st -AC foo + M foo + bar diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-copy2.t --- a/tests/test-copy2.t Mon Jun 04 14:46:42 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ - $ hg init - $ echo foo > foo -should fail - foo is not managed - $ hg mv foo bar - foo: not copying - file is not managed - abort: no files to copy - [255] - $ hg st -A - ? foo - $ hg add foo -dry-run; print a warning that this is not a real copy; foo is added - $ hg mv --dry-run foo bar - foo has not been committed yet, so no copy data will be stored for bar. - $ hg st -A - A foo -should print a warning that this is not a real copy; bar is added - $ hg mv foo bar - foo has not been committed yet, so no copy data will be stored for bar. - $ hg st -A - A bar -should print a warning that this is not a real copy; foo is added - $ hg cp bar foo - bar has not been committed yet, so no copy data will be stored for foo. - $ hg rm -f bar - $ rm bar - $ hg st -A - A foo - $ hg commit -m1 - -moving a missing file - $ rm foo - $ hg mv foo foo3 - foo: deleted in working copy - foo3 does not exist! - $ hg up -qC . - -copy --after to a nonexistant target filename - $ hg cp -A foo dummy - foo: not recording copy - dummy does not exist - -dry-run; should show that foo is clean - $ hg copy --dry-run foo bar - $ hg st -A - C foo -should show copy - $ hg copy foo bar - $ hg st -C - A bar - foo - -shouldn't show copy - $ hg commit -m2 - $ hg st -C - -should match - $ hg debugindex foo - rev offset length base linkrev nodeid p1 p2 - 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000 - $ hg debugrename bar - bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd - - $ echo bleah > foo - $ echo quux > bar - $ hg commit -m3 - -should not be renamed - $ hg debugrename bar - bar not renamed - - $ hg copy -f foo bar -should show copy - $ hg st -C - M bar - foo - $ hg commit -m3 - -should show no parents for tip - $ hg debugindex bar - rev offset length base linkrev nodeid p1 p2 - 0 0 69 0 1 7711d36246cc 000000000000 000000000000 - 1 69 6 1 2 bdf70a2b8d03 7711d36246cc 000000000000 - 2 75 81 1 3 b2558327ea8d 000000000000 000000000000 -should match - $ hg debugindex foo - rev offset length base linkrev nodeid p1 p2 - 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000 - 1 5 7 1 2 dd12c926cf16 2ed2a3912a0b 000000000000 - $ hg debugrename bar - bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17 - -should show no copies - $ hg st -C - -copy --after on an added file - $ cp bar baz - $ hg add baz - $ hg cp -A bar baz - $ hg st -C - A baz - bar - -foo was clean: - $ hg st -AC foo - C foo -but it's considered modified after a copy --after --force - $ hg copy -Af bar foo - $ hg st -AC foo - M foo - bar diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-extension.t --- a/tests/test-extension.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-extension.t Thu Jun 07 15:55:12 2012 +0200 @@ -178,8 +178,7 @@ list of commands: - foo: - yet another foo command + foo yet another foo command global options: @@ -208,10 +207,8 @@ list of commands: - debugfoobar: - yet another debug command - foo: - yet another foo command + debugfoobar yet another debug command + foo yet another foo command global options: @@ -328,7 +325,7 @@ list of commands: - extdiff use external program to diff repository (or selected files) + extdiff use external program to diff repository (or selected files) use "hg -v help extdiff" to show builtin aliases and global options diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-help.t --- a/tests/test-help.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-help.t Thu Jun 07 15:55:12 2012 +0200 @@ -5,46 +5,46 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details $ hg -q - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) $ hg help Mercurial Distributed SCM @@ -211,42 +211,26 @@ basic commands: - add: - add the specified files on the next commit - annotate, blame: - show changeset information by line for each file - clone: - make a copy of an existing repository - commit, ci: - commit the specified files or all outstanding changes - diff: - diff repository (or selected files) - export: - dump the header and diffs for one or more changesets - forget: - forget the specified files on the next commit - init: - create a new repository in the given directory - log, history: - show revision history of entire repository or files - merge: - merge working directory with another revision - phase: - set or show the current phase name - pull: - pull changes from the specified source - push: - push changes to the specified destination - remove, rm: - remove the specified files on the next commit - serve: - start stand-alone webserver - status, st: - show changed files in the working directory - summary, sum: - summarize working directory state - update, up, checkout, co: - update working directory (or switch revisions) + add add the specified files on the next commit + annotate, blame + show changeset information by line for each file + clone make a copy of an existing repository + commit, ci commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log, history show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove, rm remove the specified files on the next commit + serve start stand-alone webserver + status, st show changed files in the working directory + summary, sum summarize working directory state + update, up, checkout, co + update working directory (or switch revisions) global options: @@ -389,8 +373,8 @@ $ hg help ad list of commands: - add add the specified files on the next commit - addremove add all new files, delete all missing files + add add the specified files on the next commit + addremove add all new files, delete all missing files use "hg -v help ad" to show builtin aliases and global options @@ -539,24 +523,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] @@ -567,24 +551,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] @@ -614,6 +598,15 @@ use "hg -v help nohelp" to show more info + $ hg help -k nohelp + Commands: + + nohelp hg nohelp + + Extension Commands: + + nohelp (no help text available) + Test that default list of commands omits extension commands $ hg help @@ -711,7 +704,7 @@ list of commands: - nohelp (no help text available) + nohelp (no help text available) use "hg -v help helpext" to show builtin aliases and global options diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-qrecord.t --- a/tests/test-qrecord.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-qrecord.t Thu Jun 07 15:55:12 2012 +0200 @@ -6,7 +6,8 @@ help record (no record) $ hg help record - record extension - commands to interactively select changes for commit/qrefresh + record extension - commands to interactively select changes for + commit/qrefresh use "hg help extensions" for information on enabling extensions diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-revlog-ancestry.py --- a/tests/test-revlog-ancestry.py Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-revlog-ancestry.py Thu Jun 07 15:55:12 2012 +0200 @@ -47,27 +47,31 @@ # Ancestors print 'Ancestors of 5' - for r in repo.changelog.ancestors(5): + for r in repo.changelog.ancestors([5]): print r, print '\nAncestors of 6 and 5' - for r in repo.changelog.ancestors(6, 5): + for r in repo.changelog.ancestors([6, 5]): print r, print '\nAncestors of 5 and 4' - for r in repo.changelog.ancestors(5, 4): + for r in repo.changelog.ancestors([5, 4]): + print r, + + print '\nAncestors of 7, stop at 6' + for r in repo.changelog.ancestors([7], 6): print r, # Descendants print '\n\nDescendants of 5' - for r in repo.changelog.descendants(5): + for r in repo.changelog.descendants([5]): print r, print '\nDescendants of 5 and 3' - for r in repo.changelog.descendants(5, 3): + for r in repo.changelog.descendants([5, 3]): print r, print '\nDescendants of 5 and 4' - for r in repo.changelog.descendants(5, 4): + for r in repo.changelog.descendants([5, 4]): print r, diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-revlog-ancestry.py.out --- a/tests/test-revlog-ancestry.py.out Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-revlog-ancestry.py.out Thu Jun 07 15:55:12 2012 +0200 @@ -4,6 +4,8 @@ 3 4 2 1 0 Ancestors of 5 and 4 4 2 0 +Ancestors of 7, stop at 6 +6 Descendants of 5 7 8 diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-revset.t --- a/tests/test-revset.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-revset.t Thu Jun 07 15:55:12 2012 +0200 @@ -1,5 +1,3 @@ - $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate /a/b/c/ as if it was a real file path - $ HGENCODING=utf-8 $ export HGENCODING @@ -59,8 +57,8 @@ $ hg co 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ hg branch /a/b/c/ - marked working directory as branch /a/b/c/ + $ hg branch !a/b/c/ + marked working directory as branch !a/b/c/ (branches are permanent and global, did you want a bookmark?) $ hg ci -Aqm"5 bug" @@ -254,7 +252,7 @@ 2 a-b-c- 3 +a+b+c+ 4 -a-b-c- - 5 /a/b/c/ + 5 !a/b/c/ 6 _a_b_c_ 7 .a.b.c. $ log 'children(ancestor(4,5))' diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-strict.t --- a/tests/test-strict.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-strict.t Thu Jun 07 15:55:12 2012 +0200 @@ -19,24 +19,24 @@ basic commands: - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge working directory with another revision - phase set or show the current phase name - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) + add add the specified files on the next commit + annotate show changeset information by line for each file + clone make a copy of an existing repository + commit commit the specified files or all outstanding changes + diff diff repository (or selected files) + export dump the header and diffs for one or more changesets + forget forget the specified files on the next commit + init create a new repository in the given directory + log show revision history of entire repository or files + merge merge working directory with another revision + phase set or show the current phase name + pull pull changes from the specified source + push push changes to the specified destination + remove remove the specified files on the next commit + serve start stand-alone webserver + status show changed files in the working directory + summary summarize working directory state + update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details [255] diff -r 5e3a1b96dbb0 -r d628bcb3a567 tests/test-tags.t --- a/tests/test-tags.t Mon Jun 04 14:46:42 2012 -0700 +++ b/tests/test-tags.t Thu Jun 07 15:55:12 2012 +0200 @@ -1,5 +1,3 @@ - $ "$TESTDIR/hghave" unix-permissions || exit 80 - Helper functions: $ cacheexists() { @@ -77,11 +75,13 @@ And again, but now unable to write tag cache: +#if unix-permissions $ rm -f .hg/cache/tags $ chmod 555 .hg $ hg identify b9154636be93 tip $ chmod 755 .hg +#endif Create a branch: