1. Graham Helliwell
  2. guestrepo

Source

guestrepo / tests / test-guest-arguments.t

The default branch has multiple heads

# Guestrepo: A Mercurial Extension for the managing of components
# Copyright (C) 2012   Schweitzer Engineering Laboratories, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

# Contact information:

# opensource@selinc.com

# Schweitzer Engineering Laboratories, Inc.
# 2350 NE Hopkins Court
# Pullman, WA 99163 - USA

Make three repos
  $ for reponame in host one two three; do
  $ mkdir $reponame
  $ cd $reponame
  $ hg init
  $ echo c > f
  $ hg add f
  $ hg commit -m 0
  $ cd ..; done

Add guest repos
  $ cd host
  $ for reponame in one two three; do
  $ echo $reponame = $reponame default >> .hgguestrepo
  $ echo $reponame = `readlink -f -n ../$reponame` >> .hggrmapping; done
  $ hg add .hggrmapping .hgguestrepo
  $ hg commit -m 1

Test cloning one guest
  $ hg grup one
  cloning one
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Clone others
  $ hg grup two three
  cloning two
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  cloning three
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Test with absolute path
  $ hg grupdate `readlink -f -n one`
  GR updating one
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Test from subdirectory
  $ mkdir sub
  $ cd sub
  $ hg grupdate ../one
  GR updating one
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ..

Test from outside the repository
  $ cd ..
  $ hg grupdate -R host ./host/one
  GR updating one
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Test missing guests
  $ cd host
  $ hg grupdate nonexistant
  abort: nonexistant is not a guest repository
  [255]

Test push and pull
  $ hg grpush two three
  pushing to /tmp/*/test-guest-arguments.t/two (glob)
  searching for changes
  no changes found
  pushing to /tmp/*/test-guest-arguments.t/three (glob)
  searching for changes
  no changes found

  $ hg grpush nonexistant/nonexistant
  abort: nonexistant/nonexistant is not a guest repository
  [255]

  $ hg grpull two three
  pulling two
  pulling from /tmp/*/test-guest-arguments.t/two (glob)
  searching for changes
  no changes found
  pulling three
  pulling from /tmp/*/test-guest-arguments.t/three (glob)
  searching for changes
  no changes found

  $ hg grpull nonexistant
  abort: nonexistant is not a guest repository
  [255]