view tests/test-abort-checkin.t @ 16749:eab8ca175262

bdiff: use Py_ssize_t instead of int Reduces the conversion warnings mercurial/bdiff.c(61) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data mercurial/bdiff.c(307) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data mercurial/bdiff.c(308) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data mercurial/bdiff.c(362) : warning C4244: '+=' : conversion from '__int64' to 'int', possible loss of data mercurial/bdiff.c(380) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data mercurial/bdiff.c(381) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(382) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(416) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data to mercurial/bdiff.c(383) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(384) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(385) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uint32_t', possible loss of data on the three putbe32() calls in the function bdiff when compiling for Windows x64 target using the Microsoft compiler.
author Adrian Buehlmann <adrian@cadifra.com>
date Tue, 15 May 2012 22:36:27 +0200
parents 92e30e135581
children f2719b387380
line wrap: on
line source

  $ cat > abortcommit.py <<EOF
  > from mercurial import util
  > def hook(**args):
  >     raise util.Abort("no commits allowed")
  > def reposetup(ui, repo):
  >     repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
  > EOF
  $ abspath=`pwd`/abortcommit.py

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH
  $ echo "abortcommit = $abspath" >> $HGRCPATH

  $ hg init foo
  $ cd foo
  $ echo foo > foo
  $ hg add foo

mq may keep a reference to the repository so __del__ will not be
called and .hg/journal.dirstate will not be deleted:

  $ hg ci -m foo
  error: pretxncommit.nocommits hook failed: no commits allowed
  transaction abort!
  rollback completed
  abort: no commits allowed
  [255]
  $ hg ci -m foo
  error: pretxncommit.nocommits hook failed: no commits allowed
  transaction abort!
  rollback completed
  abort: no commits allowed
  [255]