view tests/test-pull-http.t @ 13033:026053f691a4

mq: add an '-e/--exact' option to qpush This patch adds an '--exact/-e' option to qpush that will try to push the patches in the correct location in the DAG. Specifying this option does the following: * If --move is specified, abort. It makes no sense to move a patch to the front of the queue and try to apply it to its parent, because its parent is one of the patches we just moved it in front of! * If patches are already applied, abort. We don't want patch changesets scattered throughout the DAG. * If local changes are present, abort unless --force is used, as usual. * Find the first patch we're going to push (if we're pushing multiple patches with a target or --all). * If that patch doesn't have a parent, abort, obviously. * If the parent doesn't exist in the repo, abort. Something is wrong. * Update to the parent, then continue pushing the patches as normal.
author Steve Losh <steve@stevelosh.com>
date Wed, 17 Nov 2010 21:18:44 -0500
parents 4c4aeaab2339
children 682edefe7dbb
line wrap: on
line source


  $ cp "$TESTDIR"/printenv.py .
  $ hg init test
  $ cd test
  $ echo a > a
  $ hg ci -Ama
  adding a
  $ cd ..
  $ hg clone test test2
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd test2
  $ echo a >> a
  $ hg ci -mb

expect error, cloning not allowed

  $ echo '[web]' > .hg/hgrc
  $ echo 'allowpull = false' >> .hg/hgrc
  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
  $ cat hg.pid >> $DAEMON_PIDS
  $ hg clone http://localhost:$HGPORT/ test3
  requesting all changes
  abort: authorization failed
  [255]
  $ "$TESTDIR/killdaemons.py"

serve errors

  $ cat errors.log
  $ req() {
  >     hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
  >     cat hg.pid >> $DAEMON_PIDS
  >     hg --cwd ../test pull http://localhost:$HGPORT/
  >     kill `cat hg.pid`
  >     echo % serve errors
  >     cat errors.log
  > }

expect error, pulling not allowed

  $ req
  pulling from http://localhost:$HGPORT/
  searching for changes
  abort: authorization failed
  % serve errors