tests/test-revset-outgoing.t
author Mads Kiilerich <mads@kiilerich.com>
Mon, 11 Jun 2012 01:40:51 +0200
changeset 16913 f2719b387380
parent 15623 fc8c7a5ccc4a
child 20117 aa9385f983fa
permissions -rw-r--r--
tests: add missing trailing 'cd ..' Many tests didn't change back from subdirectories at the end of the tests ... and they don't have to. The missing 'cd ..' could always be added when another test case is added to the test file. This change do that tests (99.5%) consistently end up in $TESTDIR where they started, thus making it simpler to extend them or move them around.

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > graphlog=
  > 
  > [alias]
  > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n"
  > tglog = tlog -G
  > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n"
  > EOF

  $ hg init a
  $ cd a

  $ echo a > a
  $ hg ci -Aqm0

  $ echo foo >> a
  $ hg ci -Aqm1

  $ hg up -q 0

  $ hg branch stable
  marked working directory as branch stable
  (branches are permanent and global, did you want a bookmark?)
  $ echo bar >> a
  $ hg ci -qm2

  $ hg tglog
  @  2:7bee6c3bea3a: '2' stable
  |
  | o  1:3560197d8331: '1'
  |/
  o  0:f7b1eb17ad24: '0'
  

  $ cd ..

  $ hg clone -q a#stable b

  $ cd b
  $ cat .hg/hgrc
  [paths]
  default = $TESTTMP/a#stable (glob)

  $ echo red >> a
  $ hg ci -qm3

  $ hg up -q default

  $ echo blue >> a
  $ hg ci -qm4

  $ hg tglog
  @  3:f0461977a3db: '4'
  |
  | o  2:1d4099801a4e: '3' stable
  | |
  | o  1:7bee6c3bea3a: '2' stable
  |/
  o  0:f7b1eb17ad24: '0'
  

  $ hg tout
  comparing with $TESTTMP/a (glob)
  searching for changes
  2:1d4099801a4e: '3' stable

  $ hg tlog -r 'outgoing()'
  2:1d4099801a4e: '3' stable

  $ hg tout ../a#default
  comparing with ../a
  searching for changes
  3:f0461977a3db: '4' 

  $ hg tlog -r 'outgoing("../a#default")'
  3:f0461977a3db: '4' 

  $ echo "green = ../a#default" >> .hg/hgrc

  $ cat .hg/hgrc
  [paths]
  default = $TESTTMP/a#stable (glob)
  green = ../a#default

  $ hg tout green
  comparing with $TESTTMP/a (glob)
  searching for changes
  3:f0461977a3db: '4' 

  $ hg tlog -r 'outgoing("green")'
  3:f0461977a3db: '4' 

  $ cd ..