diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -301,7 +301,8 @@ """convert user names to PHIDs""" query = {'constraints': {'usernames': names}} result = callconduit(repo, 'user.search', query) - # username not found is not an error of the API. So check if we have missed + # username not foun + # d is not an error of the API. So check if we have missed # some names here. data = result[r'data'] resolved = set(entry[r'fields'][r'username'] for entry in data) diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -250,7 +250,7 @@ util.writefile(file, newdata) @internaltool('prompt', nomerge) -def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): +def _iprompt(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels=None): """Asks the user which of the local `p1()` or the other `p2()` version to keep as the merged version.""" ui = repo.ui @@ -275,26 +275,26 @@ choice = ['local', 'other', 'unresolved'][index] if choice == 'other': - return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, + return _iother(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels) elif choice == 'local': - return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, + return _ilocal(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels) elif choice == 'unresolved': - return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, + return _ifail(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels) except error.ResponseExpected: ui.write("\n") - return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, + return _ifail(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels) @internaltool('local', nomerge) -def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): +def _ilocal(repo, wtcx, mynode, orig, fcd, fco, fca, toolconf, labels=None): """Uses the local `p1()` version of files as the merged version.""" return 0, fcd.isabsent() @internaltool('other', nomerge) -def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): +def _iother(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels=None): """Uses the other `p2()` version of files as the merged version.""" if fco.isabsent(): # local changed, remote deleted -- 'deleted' picked @@ -306,7 +306,7 @@ return 0, deleted @internaltool('fail', nomerge) -def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): +def _ifail(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, labels=None): """ Rather than attempting to merge files that were modified on both branches, it marks them as unresolved. The resolve command must be @@ -374,7 +374,8 @@ return False return True -def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode): +def _merge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, labels, + mode): """ Uses the internal non-interactive simple merge algorithm for merging files. It will fail if there are any conflicts and leave markers in @@ -392,32 +393,35 @@ _("warning: conflicts while merging %s! " "(edit, then use 'hg resolve --mark')\n"), precheck=_mergecheck) -def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _iunion(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Uses the internal non-interactive simple merge algorithm for merging files. It will use both left and right sides for conflict regions. No markers are inserted.""" - return _merge(repo, mynode, orig, fcd, fco, fca, toolconf, + return _merge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, labels, 'union') @internaltool('merge', fullmerge, _("warning: conflicts while merging %s! " "(edit, then use 'hg resolve --mark')\n"), precheck=_mergecheck) -def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _imerge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Uses the internal non-interactive simple merge algorithm for merging files. It will fail if there are any conflicts and leave markers in the partially merged file. Markers will have two sections, one for each side of merge.""" - return _merge(repo, mynode, orig, fcd, fco, fca, toolconf, + return _merge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, labels, 'merge') @internaltool('merge3', fullmerge, _("warning: conflicts while merging %s! " "(edit, then use 'hg resolve --mark')\n"), precheck=_mergecheck) -def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _imerge3(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Uses the internal non-interactive simple merge algorithm for merging files. It will fail if there are any conflicts and leave markers in @@ -427,9 +431,10 @@ labels = _defaultconflictlabels if len(labels) < 3: labels.append('base') - return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) + return _imerge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels) -def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files, +def _imergeauto(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, labels=None, localorother=None): """ Generic driver for _imergelocal and _imergeother @@ -462,15 +467,17 @@ _("automatic tag merging of %s failed! " "(use 'hg resolve --tool :merge' or another merge " "tool of your choice)\n")) -def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _itagmerge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Uses the internal tag merge algorithm (experimental). """ - success, status = tagmerge.merge(repo, fcd, fco, fca) + success, status = tagmerge.merge(repo, wctx, fcd, fco, fca) return success, status, False @internaltool('dump', fullmerge) -def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _idump(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Creates three versions of the files to merge, containing the contents of local, other and base. These files can then be used to @@ -492,15 +499,16 @@ return False, 1, False @internaltool('forcedump', mergeonly) -def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files, - labels=None): +def _forcedump(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): """ Creates three versions of the files as same as :dump, but omits premerge. """ - return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, - labels=labels) + return _idump(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=labels) -def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): +def _xmerge(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, + labels=None): tool, toolpath, binary, symlink = toolconf if fcd.isabsent() or fco.isabsent(): repo.ui.warn(_('warning: %s cannot merge change/delete conflict ' @@ -651,7 +659,8 @@ toolconf = tool, toolpath, binary, symlink if mergetype == nomerge: - r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels) + r, deleted = func(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, + labels) return True, r, deleted if premerge: @@ -692,7 +701,7 @@ # complete if premerge successful (r is 0) return not r, r, False - needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca, + needcheck, r, deleted = func(repo, wctx, mynode, orig, fcd, fco, fca, toolconf, files, labels=labels) if needcheck: diff --git a/mercurial/tagmerge.py b/mercurial/tagmerge.py --- a/mercurial/tagmerge.py +++ b/mercurial/tagmerge.py @@ -216,7 +216,7 @@ # whole list of lr nodes return lrnodes + hrnodes[commonidx:] -def merge(repo, fcd, fco, fca): +def merge(repo, wctx, fcd, fco, fca): ''' Merge the tags of two revisions, taking into account the base tags Try to minimize the diff between the merged tags and the first parent tags