# HG changeset patch # User Thomas Arendsen Hein # Date 2008-02-13 23:13:20 # Node ID 41aa0a37d9be14c85eef9affd746d9a498e47d83 # Parent 152b6c5c1574871124f9c093bcbbbeda5594e927 # Parent fb259a3572e95861dfd30a6e32a2b6b5a4305ec0 merge with main diff --git a/contrib/mergetools.hgrc b/contrib/mergetools.hgrc --- a/contrib/mergetools.hgrc +++ b/contrib/mergetools.hgrc @@ -28,6 +28,7 @@ xxdiff.gui=True xxdiff.priority=-8 diffmerge.args=--nosplash --merge --title1=base --title2=local --title3=other $base $local $other +diffmerge.checkchanged=True diffmerge.gui=True p4merge.args=$base $local $other $output diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -289,6 +289,10 @@ merge-tools:: Check whether there are conflicts even though the tool reported success. Default: False + checkchanged;; + Check whether outputs were written even though the tool reported + success. + Default: False fixeol;; Attempt to fix up EOL changes caused by the merge tool. Default: False diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -71,7 +71,7 @@ class convert_cvs(converter_source): elif l.startswith("Ancestor branch"): ancestor = l[17:-1] # figure out the parent later - self.parent[id] = None + self.parent[id] = self.lastbranch[ancestor] elif l.startswith("Author"): author = self.recode(l[8:-1]) elif l.startswith("Tag:") or l.startswith("Tags:"): @@ -101,13 +101,14 @@ class convert_cvs(converter_source): p = [] if branch == "HEAD": branch = "" - if branch and p[0] == None: + if branch: latest = None # the last changeset that contains a base # file is our parent for r in oldrevs: - latest = max(filerevids[r], latest) - p = [latest] + latest = max(filerevids.get(r, None), latest) + if latest: + p = [latest] # add current commit to set c = commit(author=author, date=date, parents=p, diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -7,7 +7,7 @@ from node import * from i18n import _ -import util, os, tempfile, context, simplemerge, re +import util, os, tempfile, context, simplemerge, re, filecmp def _toolstr(ui, tool, part, default=""): return ui.config("merge-tools", tool + "." + part, default) @@ -60,10 +60,14 @@ def _picktool(repo, ui, path, binary, sy t = k.split('.')[0] if t not in tools: tools[t] = int(_toolstr(ui, t, "priority", "0")) + names = tools.keys() tools = [(-p,t) for t,p in tools.items()] tools.sort() - if ui.config("ui", "merge"): - tools.insert(0, (None, ui.config("ui", "merge"))) # highest priority + uimerge = ui.config("ui", "merge") + if uimerge: + if uimerge not in names: + return (uimerge, uimerge) + tools.insert(0, (None, uimerge)) # highest priority tools.append((None, "hgmerge")) # the old default, if found for p,t in tools: toolpath = _findtool(ui, t) @@ -193,6 +197,13 @@ def filemerge(repo, fw, fd, fo, wctx, mc if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcm.data()): r = 1 + if not r and _toolbool(ui, tool, "checkchanged"): + if filecmp.cmp(repo.wjoin(fd), back): + if ui.prompt(_(" output file %s appears unchanged\n" + "was merge successful (yn)?") % fd, + _("[yn]"), _("n")) != _("y"): + r = 1 + if _toolbool(ui, tool, "fixeol"): _matcheol(repo.wjoin(fd), back) diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -459,6 +459,8 @@ def _matcher(canonroot, cwd, names, inc, return try: pat = '(?:%s)' % '|'.join([regex(k, p, tail) for (k, p) in pats]) + if len(pat) > 20000: + raise OverflowError() return re.compile(pat).match except OverflowError: # We're using a Python with a tiny regex engine and we