Mercurial > hg-stable
changeset 1883:b98160cfb2f3
give more info to hgmerge script.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 10 Mar 2006 23:34:02 -0800 |
parents | c0320567931f |
children | 4e44ca05a866 |
files | hgmerge mercurial/localrepo.py |
diffstat | 2 files changed, 18 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hgmerge Fri Mar 10 22:42:59 2006 -0800 +++ b/hgmerge Fri Mar 10 23:34:02 2006 -0800 @@ -4,11 +4,15 @@ # # This tries to find a way to do three-way merge on the current system. # The result ought to end up in $1. +# +# Environment variables set by Mercurial: +# HG_ROOT repo root +# HG_FILE name of file within repo +# HG_MY_NODE revision being merged +# HG_OTHER_NODE revision being merged set -e # bail out quickly on failure -echo $1 $2 $3 - LOCAL="$1" BASE="$2" OTHER="$3"
--- a/mercurial/localrepo.py Fri Mar 10 22:42:59 2006 -0800 +++ b/mercurial/localrepo.py Fri Mar 10 23:34:02 2006 -0800 @@ -1636,10 +1636,12 @@ # merge the tricky bits files = merge.keys() files.sort() + xp1 = hex(p1) + xp2 = hex(p2) for f in files: self.ui.status(_("merging %s\n") % f) my, other, flag = merge[f] - ret = self.merge3(f, my, other) + ret = self.merge3(f, my, other, xp1, xp2) if ret: err = True util.set_exec(self.wjoin(f), flag) @@ -1677,7 +1679,7 @@ self.dirstate.setparents(p1, p2) return err - def merge3(self, fn, my, other): + def merge3(self, fn, my, other, p1, p2): """perform a 3-way merge in the working directory""" def temp(prefix, node): @@ -1700,7 +1702,14 @@ cmd = (os.environ.get("HGMERGE") or self.ui.config("ui", "merge") or "hgmerge") - r = os.system('%s "%s" "%s" "%s"' % (cmd, a, b, c)) + r = util.system('%s "%s" "%s" "%s"' % (cmd, a, b, c), + environ={'HG_ROOT': self.root, + 'HG_FILE': fn, + 'HG_MY_NODE': p1, + 'HG_OTHER_NODE': p2, + 'HG_FILE_MY_NODE': hex(my), + 'HG_FILE_OTHER_NODE': hex(other), + 'HG_FILE_BASE_NODE': hex(base)}) if r: self.ui.warn(_("merging %s failed!\n") % fn)