view tests/test-schemes.t @ 19812:5d6cfdc38a3d

mq: simplifies the refresh hint in checklocalchanges The `checklocalchanges` function in the `mq.queue` class takes a `refresh` argument that changes the error message of raised exception. When refresh is `True` the exception message is "local changes found, refresh first" otherwise, the message is just "local changes found". This changeset is the first of a series that extract `strip` into a standalone extension (as discussed in issue3824). This `checklocalchanges` function is indirectly used by the strip command. But in a standalone strip extension the concept of "refresh first" has no sense. In practice, When used in the context of the strip commands `refresh`'s value is always `False`. So my final goal is a be able to extract the `checklocalchanges` logic in a standalone extension but to keep the part related to "refresh first" in the mq extension. However the refresh handling is deeply entangled into the `checklocalchanges` code. It is handled as low a possible at the point we raise the exception. So we moves handling of refresh upper in the `checklocalchanges` code. This will allow the extraction of a simple version in the strip extension while mq can still inject its logic when needed. Two helper functions `localchangesfound` and `localchangedsubreposfound` died in the process they are replaced by simple raise lines.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 25 Sep 2013 12:28:40 +0200
parents b52404a914a9
children 7a9cbb315d84
line wrap: on
line source

  $ "$TESTDIR/hghave" serve || exit 80

  $ cat <<EOF >> $HGRCPATH
  > [extensions]
  > schemes=
  > 
  > [schemes]
  > l = http://localhost:$HGPORT/
  > parts = http://{1}:$HGPORT/
  > z = file:\$PWD/
  > EOF
  $ hg init test
  $ cd test
  $ echo a > a
  $ hg ci -Am initial
  adding a

invalid scheme

  $ hg log -R z:z
  abort: no '://' in scheme url 'z:z'
  [255]

http scheme

  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
  $ cat hg.pid >> $DAEMON_PIDS
  $ hg incoming l://
  comparing with l://
  searching for changes
  no changes found
  [1]

check that {1} syntax works

  $ hg incoming --debug parts://localhost
  using http://localhost:$HGPORT/
  sending capabilities command
  comparing with parts://localhost/
  query 1; heads
  sending batch command
  searching for changes
  all remote heads known locally
  no changes found
  [1]

check that paths are expanded

  $ PWD=`pwd` hg incoming z://
  comparing with z://
  searching for changes
  no changes found
  [1]

errors

  $ cat errors.log

  $ cd ..