diff --git a/contrib/shrink-revlog.py b/contrib/shrink-revlog.py --- a/contrib/shrink-revlog.py +++ b/contrib/shrink-revlog.py @@ -19,17 +19,17 @@ This is *not* safe to run on a changelog # e.g. by comparing "before" and "after" states of random changesets # (maybe: export before, shrink, export after, diff). -import sys, os, tempfile -import optparse -from mercurial import ui as ui_, hg, revlog, transaction, node, util +import os, tempfile +from mercurial import revlog, transaction, node, util from mercurial import changegroup +from mercurial.i18n import _ def toposort(ui, rl): children = {} root = [] # build children and roots - ui.status('reading revs\n') + ui.status(_('reading revs\n')) try: for i in rl: ui.progress(_('reading'), i, total=len(rl)) @@ -50,7 +50,7 @@ def toposort(ui, rl): # XXX this is a reimplementation of the 'branchsort' topo sort # algorithm in hgext.convert.convcmd... would be nice not to duplicate # the algorithm - ui.status('sorting revs\n') + ui.status(_('sorting revs\n')) visit = root ret = [] while visit: @@ -71,7 +71,7 @@ def toposort(ui, rl): def writerevs(ui, r1, r2, order, tr): - ui.status('writing revs\n') + ui.status(_('writing revs\n')) count = [0] def progress(*args): @@ -97,61 +97,60 @@ def report(ui, olddatafn, newdatafn): # argh: have to pass an int to %d, because a float >= 2^32 # blows up under Python 2.5 or earlier - ui.write('old file size: %12d bytes (%6.1f MiB)\n' + ui.write(_('old file size: %12d bytes (%6.1f MiB)\n') % (int(oldsize), oldsize / 1024 / 1024)) - ui.write('new file size: %12d bytes (%6.1f MiB)\n' + ui.write(_('new file size: %12d bytes (%6.1f MiB)\n') % (int(newsize), newsize / 1024 / 1024)) shrink_percent = (oldsize - newsize) / oldsize * 100 shrink_factor = oldsize / newsize - ui.write('shrinkage: %.1f%% (%.1fx)\n' % (shrink_percent, shrink_factor)) + ui.write(_('shrinkage: %.1f%% (%.1fx)\n') + % (shrink_percent, shrink_factor)) def shrink(ui, repo, **opts): """ Shrink revlog by re-ordering revisions. Will operate on manifest for the given repository if no other revlog is specified.""" - # Unbuffer stdout for nice progress output. - sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) - if not repo.local(): - raise util.Abort('not a local repository: %s' % repo.root) + raise util.Abort(_('not a local repository: %s') % repo.root) fn = opts.get('revlog') if not fn: indexfn = repo.sjoin('00manifest.i') else: if not fn.endswith('.i'): - raise util.Abort('--revlog option must specify the revlog index ' - 'file (*.i), not %s' % opts.get('revlog')) + raise util.Abort(_('--revlog option must specify the revlog index ' + 'file (*.i), not %s') % opts.get('revlog')) indexfn = os.path.realpath(fn) store = repo.sjoin('') if not indexfn.startswith(store): - raise util.Abort('--revlog option must specify a revlog in %s, ' - 'not %s' % (store, indexfn)) + raise util.Abort(_('--revlog option must specify a revlog in %s, ' + 'not %s') % (store, indexfn)) datafn = indexfn[:-2] + '.d' if not os.path.exists(indexfn): - raise util.Abort('no such file: %s' % indexfn) + raise util.Abort(_('no such file: %s') % indexfn) if '00changelog' in indexfn: - raise util.Abort('shrinking the changelog will corrupt your repository') + raise util.Abort(_('shrinking the changelog ' + 'will corrupt your repository')) if not os.path.exists(datafn): # This is just a lazy shortcut because I can't be bothered to # handle all the special cases that entail from no .d file. - raise util.Abort('%s does not exist: revlog not big enough ' - 'to be worth shrinking' % datafn) + raise util.Abort(_('%s does not exist: revlog not big enough ' + 'to be worth shrinking') % datafn) oldindexfn = indexfn + '.old' olddatafn = datafn + '.old' if os.path.exists(oldindexfn) or os.path.exists(olddatafn): - raise util.Abort('one or both of\n' - ' %s\n' - ' %s\n' - 'exists from a previous run; please clean up before ' - 'running again' % (oldindexfn, olddatafn)) + raise util.Abort(_('one or both of\n' + ' %s\n' + ' %s\n' + 'exists from a previous run; please clean up ' + 'before running again') % (oldindexfn, olddatafn)) - ui.write('shrinking %s\n' % indexfn) + ui.write(_('shrinking %s\n') % indexfn) prefix = os.path.basename(indexfn)[:-1] (tmpfd, tmpindexfn) = tempfile.mkstemp(dir=os.path.dirname(indexfn), prefix=prefix, @@ -199,20 +198,20 @@ def shrink(ui, repo, **opts): lock.release() if not opts.get('dry_run'): - ui.write('note: old revlog saved in:\n' - ' %s\n' - ' %s\n' - '(You can delete those files when you are satisfied that your\n' - 'repository is still sane. ' - 'Running \'hg verify\' is strongly recommended.)\n' + ui.write(_('note: old revlog saved in:\n' + ' %s\n' + ' %s\n' + '(You can delete those files when you are satisfied that your\n' + 'repository is still sane. ' + 'Running \'hg verify\' is strongly recommended.)\n') % (oldindexfn, olddatafn)) cmdtable = { 'shrink': (shrink, - [('', 'revlog', '', 'index (.i) file of the revlog to shrink'), - ('n', 'dry-run', None, 'do not shrink, simulate only'), + [('', 'revlog', '', _('index (.i) file of the revlog to shrink')), + ('n', 'dry-run', None, _('do not shrink, simulate only')), ], - 'hg shrink [--revlog PATH]') + _('hg shrink [--revlog PATH]')) } if __name__ == "__main__": diff --git a/contrib/wix/README.txt b/contrib/wix/README.txt new file mode 100644 --- /dev/null +++ b/contrib/wix/README.txt @@ -0,0 +1,31 @@ +WiX installer source files +========================== + +The files in this folder are used by the thg-winbuild [1] package +building architecture to create a Mercurial MSI installer. These files +are versioned within the Mercurial source tree because the WXS files +must kept up to date with distribution changes within their branch. In +other words, the default branch WXS files are expected to diverge from +the stable branch WXS files. Storing them within the same repository is +the only sane way to keep the the source tree and the installer in sync. + +The MSI installer builder uses only the mercurial.ini file from the +contrib/win32 folder, the contents of which have been historically used +to create an InnoSetup based installer. The rest of the files there are +ignored. + +The MSI packages built by thg-winbuild require elevated (admin) +privileges to be installed due to the installation of MSVC CRT libraries +under the C:\WINDOWS\WinSxS folder. Thus the InnoSetup installers may +still be useful to some users. + +To build your own MSI packages, clone the thg-winbuild [1] repository +and follow the README.txt [2] instructions closely. There are fewer +prerequisites for a WiX [3] installer than an InnoSetup installer, but +they are more specific. + +Direct questions or comments to Steve Borho + +[1] http://bitbucket.org/tortoisehg/thg-winbuild +[2] http://bitbucket.org/tortoisehg/thg-winbuild/src/tip/README.txt +[3] http://wix.sourceforge.net/ diff --git a/contrib/wix/contrib.wxs b/contrib/wix/contrib.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/contrib.wxs @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/wix/doc.wxs b/contrib/wix/doc.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/doc.wxs @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/wix/help.wxs b/contrib/wix/help.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/help.wxs @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/wix/i18n.wxs b/contrib/wix/i18n.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/i18n.wxs @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/wix/locale.wxs b/contrib/wix/locale.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/locale.wxs @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/wix/mercurial.wxs b/contrib/wix/mercurial.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/mercurial.wxs @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + VersionNT >= 501 + + + + + + + mercurial@selenic.com + http://mercurial.selenic.com/wiki/ + http://mercurial.selenic.com/about/ + http://mercurial.selenic.com/downloads/ + http://mercurial.selenic.com/wiki/Support + hgIcon.ico + + + amus + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/wix/templates.wxs b/contrib/wix/templates.wxs new file mode 100644 --- /dev/null +++ b/contrib/wix/templates.wxs @@ -0,0 +1,801 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -147,7 +147,7 @@ def bookmark(ui, repo, mark=None, rev=No if rev: raise util.Abort(_("bookmark name required")) if len(marks) == 0: - ui.status("no bookmarks set\n") + ui.status(_("no bookmarks set\n")) else: for bmark, n in marks.iteritems(): if ui.configbool('bookmarks', 'track.current'): diff --git a/hgext/gpg.py b/hgext/gpg.py --- a/hgext/gpg.py +++ b/hgext/gpg.py @@ -221,8 +221,8 @@ def sign(ui, repo, *revs, **opts): for n in nodes: hexnode = hgnode.hex(n) - ui.write("Signing %d:%s\n" % (repo.changelog.rev(n), - hgnode.short(n))) + ui.write(_("Signing %d:%s\n") % (repo.changelog.rev(n), + hgnode.short(n))) # build data data = node2txt(repo, n, sigver) sig = mygpg.sign(data) diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -294,7 +294,6 @@ def demo(ui, repo, *args, **opts): for k, v in sorted(items): ui.write('%s = %s\n' % (k, v)) - msg = 'hg keyword config and expansion example' fn = 'demo.txt' branchname = 'demobranch' tmpdir = tempfile.mkdtemp('', 'kwdemo.') @@ -355,7 +354,8 @@ def demo(ui, repo, *args, **opts): if name.split('.', 1)[0].find('commit') > -1: repo.ui.setconfig('hooks', name, '') ui.note(_('unhooked all commit hooks\n')) - ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg)) + msg = _('hg keyword configuration and expansion example') + ui.note("hg -R '%s' ci -m '%s'\n" % (tmpdir, msg)) repo.commit(text=msg) ui.status(_('\n\tkeywords expanded\n')) ui.write(repo.wread(fn)) diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2199,7 +2199,7 @@ def header(ui, repo, patch=None): patch = q.lookup(patch) else: if not q.applied: - ui.write('no patches applied\n') + ui.write(_('no patches applied\n')) return 1 patch = q.lookup('qtip') ph = patchheader(q.join(patch), q.plainmode) @@ -2302,8 +2302,7 @@ def rename(ui, repo, patch, name=None, * raise util.Abort( _('A patch named %s already exists in the series file') % name) - if ui.verbose: - ui.write('renaming %s to %s\n' % (patch, name)) + ui.note(_('renaming %s to %s\n') % (patch, name)) i = q.find_series(patch) guards = q.guard_re.findall(q.full_series[i]) q.full_series[i] = name + ''.join([' #' + g for g in guards]) @@ -2664,7 +2663,7 @@ def uisetup(ui): entry = extensions.wrapcommand(commands.table, 'init', mqinit) entry[1].extend(mqopt) - for cmd in commands.table: + for cmd in commands.table.keys(): cmd = cmdutil.parsealiases(cmd)[0] if cmd in commands.norepo: continue diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -393,13 +393,13 @@ def hasnode(repo, node): def browserevs(ui, repo, nodes, opts): '''interactively transplant changesets''' def browsehelp(ui): - ui.write('y: transplant this changeset\n' - 'n: skip this changeset\n' - 'm: merge at this changeset\n' - 'p: show patch\n' - 'c: commit selected changesets\n' - 'q: cancel transplant\n' - '?: show this help\n') + ui.write(_('y: transplant this changeset\n' + 'n: skip this changeset\n' + 'm: merge at this changeset\n' + 'p: show patch\n' + 'c: commit selected changesets\n' + 'q: cancel transplant\n' + '?: show this help\n')) displayer = cmdutil.show_changeset(ui, repo, opts) transplants = [] @@ -418,7 +418,7 @@ def browserevs(ui, repo, nodes, opts): ui.write(chunk) action = None elif action not in ('y', 'n', 'm', 'c', 'q'): - ui.write('no such option\n') + ui.write(_('no such option\n')) action = None if action == 'y': transplants.append(node) diff --git a/mercurial/bdiff.c b/mercurial/bdiff.c --- a/mercurial/bdiff.c +++ b/mercurial/bdiff.c @@ -226,19 +226,23 @@ static void recurse(struct line *a, stru { int i, j, k; - /* find the longest match in this chunk */ - k = longest_match(a, b, pos, a1, a2, b1, b2, &i, &j); - if (!k) - return; + while (1) { + /* find the longest match in this chunk */ + k = longest_match(a, b, pos, a1, a2, b1, b2, &i, &j); + if (!k) + return; - /* and recurse on the remaining chunks on either side */ - recurse(a, b, pos, a1, i, b1, j, l); - l->head->a1 = i; - l->head->a2 = i + k; - l->head->b1 = j; - l->head->b2 = j + k; - l->head++; - recurse(a, b, pos, i + k, a2, j + k, b2, l); + /* and recurse on the remaining chunks on either side */ + recurse(a, b, pos, a1, i, b1, j, l); + l->head->a1 = i; + l->head->a2 = i + k; + l->head->b1 = j; + l->head->b2 = j + k; + l->head++; + /* tail-recursion didn't happen, so doing equivalent iteration */ + a1 = i + k; + b1 = j + k; + } } static struct hunklist diff(struct line *a, int an, struct line *b, int bn) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2233,14 +2233,14 @@ def merge(ui, repo, node=None, **opts): node = parent == bheads[0] and bheads[-1] or bheads[0] if opts.get('preview'): - p1 = repo['.'] - p2 = repo[node] - common = p1.ancestor(p2) - roots, heads = [common.node()], [p2.node()] + # find nodes that are ancestors of p2 but not of p1 + p1 = repo.lookup('.') + p2 = repo.lookup(node) + nodes = repo.changelog.findmissing(common=[p1], heads=[p2]) + displayer = cmdutil.show_changeset(ui, repo, opts) - for node in repo.changelog.nodesbetween(roots=roots, heads=heads)[0]: - if node not in roots: - displayer.show(repo[node]) + for node in nodes: + displayer.show(repo[node]) displayer.close() return 0 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1890,7 +1890,7 @@ class localrepository(repo.repository): lookup_filenode_link_func(fname)) for chnk in group: self.ui.progress( - 'bundle files', cnt, item=fname, unit='chunks') + _('bundle files'), cnt, item=fname, unit='chunks') cnt += 1 yield chnk if fname in msng_filenode_set: @@ -1974,10 +1974,10 @@ class localrepository(repo.repository): lookup = lookuprevlink_func(filerevlog) for chnk in filerevlog.group(nodeiter, lookup): self.ui.progress( - 'bundle files', cnt, item=fname, unit='chunks') + _('bundle files'), cnt, item=fname, unit='chunks') cnt += 1 yield chnk - self.ui.progress('bundle files', None, unit='chunks') + self.ui.progress(_('bundle files'), None, unit='chunks') yield changegroup.closechunk() diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -157,8 +157,8 @@ def split(stream): if line.split(':', 1)[0].lower() in mimeheaders: # let email parser handle this return mimesplit(stream, cur) - elif inheader: - # No evil headers seen, split by hand + elif line.startswith('--- ') and inheader: + # No evil headers seen by diff start, split by hand return headersplit(stream, cur) # Not enough info, keep reading diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -336,7 +336,7 @@ class svnsubrepo(object): self._ui.warn(_('not removing repo %s because ' 'it has changes.\n' % self._path)) return - self._ui.note('removing subrepo %s\n' % self._path) + self._ui.note(_('removing subrepo %s\n') % self._path) shutil.rmtree(self._ctx.repo.join(self._path)) def get(self, state): diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -80,10 +80,12 @@ class ui(object): self.warn(_("Ignored: %s\n") % str(inst)) if self.plain(): - for k in ('debug', 'fallbackencoding', 'quiet', 'traceback', - 'verbose'): + for k in ('debug', 'fallbackencoding', 'quiet', 'slash', + 'traceback', 'verbose'): if k in cfg['ui']: del cfg['ui'][k] + for k, v in cfg.items('alias'): + del cfg['alias'][k] for k, v in cfg.items('defaults'): del cfg['defaults'][k] diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -510,10 +510,11 @@ if has_https: keyfile = None certfile = None - if args: # key_file - keyfile = args.pop(0) - if args: # cert_file - certfile = args.pop(0) + if len(args) >= 1: # key_file + keyfile = args[0] + if len(args) >= 2: # cert_file + certfile = args[1] + args = args[2:] # if the user has specified different key/cert files in # hgrc, we prefer these diff --git a/tests/test-hgrc b/tests/test-hgrc --- a/tests/test-hgrc +++ b/tests/test-hgrc @@ -33,10 +33,13 @@ echo "[ui]" > $HGRCPATH echo "debug=true" >> $HGRCPATH echo "fallbackencoding=ASCII" >> $HGRCPATH echo "quiet=true" >> $HGRCPATH +echo "slash=true" >> $HGRCPATH echo "traceback=true" >> $HGRCPATH echo "verbose=true" >> $HGRCPATH echo "[defaults]" >> $HGRCPATH echo "identify=-n" >> $HGRCPATH +echo "[alias]" >> $HGRCPATH +echo "log=log -g" >> $HGRCPATH echo '% customized hgrc' hg showconfig | sed -e "s:$p:...:" diff --git a/tests/test-hgrc.out b/tests/test-hgrc.out --- a/tests/test-hgrc.out +++ b/tests/test-hgrc.out @@ -11,12 +11,14 @@ foo.bar=a\nb\nc\nde\nfg foo.baz=bif cb hg: config error at $HGRCPATH:1: cannot include /no-such-file (No such file or directory) % customized hgrc -.../.hgrc:8: defaults.identify=-n +.../.hgrc:11: alias.log=log -g +.../.hgrc:9: defaults.identify=-n .../.hgrc:2: ui.debug=true .../.hgrc:3: ui.fallbackencoding=ASCII .../.hgrc:4: ui.quiet=true -.../.hgrc:5: ui.traceback=true -.../.hgrc:6: ui.verbose=true +.../.hgrc:5: ui.slash=true +.../.hgrc:6: ui.traceback=true +.../.hgrc:7: ui.verbose=true % plain hgrc none: ui.traceback=True none: ui.verbose=False diff --git a/tests/test-import b/tests/test-import --- a/tests/test-import +++ b/tests/test-import @@ -372,3 +372,30 @@ hg import -d '0 0' a.patch hg parents -v cd .. +echo '% tricky header splitting' +cat > trickyheaders.patch < +Subject: [PATCH] from: tricky! + +# HG changeset patch +# User User B +# Date 1266264441 18000 +# Branch stable +# Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0 +# Parent 0000000000000000000000000000000000000000 +from: tricky! + +That is not a header. + +diff -r 000000000000 -r f2be6a1170ac foo +--- /dev/null ++++ b/foo +@@ -0,0 +1,1 @@ ++foo +EOF + +hg init trickyheaders +cd trickyheaders +hg import -d '0 0' ../trickyheaders.patch +hg export --git tip +cd .. diff --git a/tests/test-import.out b/tests/test-import.out --- a/tests/test-import.out +++ b/tests/test-import.out @@ -314,3 +314,20 @@ module: summary description +% tricky header splitting +applying ../trickyheaders.patch +# HG changeset patch +# User User B +# Date 0 0 +# Node ID eb56ab91903632294ac504838508cb370c0901d2 +# Parent 0000000000000000000000000000000000000000 +from: tricky! + +That is not a header. + +diff --git a/foo b/foo +new file mode 100644 +--- /dev/null ++++ b/foo +@@ -0,0 +1,1 @@ ++foo diff --git a/tests/test-keyword.out b/tests/test-keyword.out --- a/tests/test-keyword.out +++ b/tests/test-keyword.out @@ -213,7 +213,7 @@ b = ignore demo.txt = [keywordmaps] Xinfo = {author}: {desc} -$Xinfo: test: hg keyword config and expansion example $ +$Xinfo: test: hg keyword configuration and expansion example $ % cat expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: diff --git a/tests/test-merge-default b/tests/test-merge-default --- a/tests/test-merge-default +++ b/tests/test-merge-default @@ -4,18 +4,18 @@ hg init echo a > a hg commit -A -ma -echo a >> a +echo b >> a hg commit -mb -echo a >> a +echo c >> a hg commit -mc hg up 1 -echo a >> a +echo d >> a hg commit -md hg up 1 -echo a >> a +echo e >> a hg commit -me hg up 1 @@ -24,6 +24,7 @@ hg merge hg up echo % should fail because \> 2 heads +export HGMERGE=internal:other hg merge echo % should succeed @@ -43,10 +44,17 @@ echo % should fail because 1 head hg merge hg up 3 -echo a >> a +echo f >> a hg branch foobranch hg commit -mf echo % should fail because merge with other branch hg merge +# Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that +# are not ancestors of 7, regardless of where their least common +# ancestor is. +echo % merge preview not affected by common ancestor +hg up -q 7 +hg merge -q -P 6 # expect: 2, 4, 5, 6 + true diff --git a/tests/test-merge-default.out b/tests/test-merge-default.out --- a/tests/test-merge-default.out +++ b/tests/test-merge-default.out @@ -12,16 +12,16 @@ 1 files updated, 0 files merged, 0 files abort: branch 'default' has 3 heads - please merge with an explicit rev (run 'hg heads .' to see heads) % should succeed -0 files updated, 0 files merged, 0 files removed, 0 files unresolved +0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) % should succeed - 2 heads -changeset: 3:903c264cdf57 -parent: 1:ba677d0156c1 +changeset: 3:ea9ff125ff88 +parent: 1:1846eede8b68 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: d -0 files updated, 0 files merged, 0 files removed, 0 files unresolved +0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) % should fail because at tip abort: there is nothing to merge @@ -34,3 +34,8 @@ created new head % should fail because merge with other branch abort: branch 'foobranch' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) +% merge preview not affected by common ancestor +2:2d95304fed5d +4:f25cbe84d8b3 +5:a431fabd6039 +6:e88e33f3bf62