comparison hgsubversion/wrappers.py @ 1175:d6296f901fc7 stable

push: update push logic to match mercurial upstream Commit e10000369b47 in upstream Mercurial changed the checkpush function signature. So we need to update hgsubversion accordingly. Ran the tests against the tip of the hg repo, against a version of hg from January before the exchange module, and against a version of hg after pushoperations was added but before checkpush used it, and the tests passed in all cases.
author Durham Goode <durham@fb.com>
date Wed, 09 Apr 2014 16:17:13 -0700
parents 9a7e3dbd0f6e
children 97a064e2075d
comparison
equal deleted inserted replaced
1170:61d4fb78370b 1175:d6296f901fc7
178 """ 178 """
179 assert not revs, 'designated revisions for push remains unimplemented.' 179 assert not revs, 'designated revisions for push remains unimplemented.'
180 cmdutil.bailifchanged(repo) 180 cmdutil.bailifchanged(repo)
181 checkpush = getattr(repo, 'checkpush', None) 181 checkpush = getattr(repo, 'checkpush', None)
182 if checkpush: 182 if checkpush:
183 checkpush(force, revs) 183 try:
184 # The checkpush function changed as of e10000369b47 in mercurial
185 from mercurial.exchange import pushoperation
186 pushop = pushoperation(repo, dest, force, revs, False)
187 checkpush(pushop)
188 except (ImportError, TypeError):
189 checkpush(force, revs)
190
184 ui = repo.ui 191 ui = repo.ui
185 old_encoding = util.swap_out_encoding() 192 old_encoding = util.swap_out_encoding()
186 193
187 hasobsolete = obsolete and obsolete._enabled 194 hasobsolete = obsolete and obsolete._enabled
188 195