Mercurial > hg
view tests/failfilemerge.py @ 29324:b501579147f1
py3: conditionalize cPickle import by adding in util
The cPickle is renamed to _pickle in python3 and this C extension is available
in pickle which was not included in earlier versions. So imports are conditionalized
to import cPickle in py2 and pickle in py3. Moreover the use of pickle in py2 is
switched to cPickle as the C extension is faster. The hack is added in util.py and
the modules import util.pickle
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 04 Jun 2016 14:38:00 +0530 |
parents | 424c1632fffb |
children | a7f8939641aa |
line wrap: on
line source
# extension to emulate interupting filemerge._filemerge from __future__ import absolute_import from mercurial import ( error, extensions, filemerge, ) def failfilemerge(filemergefn, premerge, repo, mynode, orig, fcd, fco, fca, labels=None): raise error.Abort("^C") return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels) def extsetup(ui): extensions.wrapfunction(filemerge, '_filemerge', failfilemerge)