Source

guestrepo / tests / test-in.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

Pull and sync perform the same action on nonexistant repos.

This file tests that repos are cloned correctly

  $ TESTDIR=`pwd`

Make a guest repo:
  $ mkdir gr1
  $ cd gr1
  $ hg init
  $ echo c0 > f
  $ hg add f
  $ hg commit -m 0
  $ cd ..

Make another guest repo:
  $ mkdir gr2
  $ cd gr2
  $ hg init
  $ echo c02 > g
  $ hg add g
  $ hg commit -m 0
  $ cd ..

Make host:
  $ mkdir host
  $ cd host
  $ hg init
  $ echo mygr1 = mygr1-name default >> .hgguestrepo
  $ echo mygr1-name = `readlink -f -n ../gr1` >> .hggrmapping
  $ echo mygr2 = mygr2-name default >> .hgguestrepo
  $ echo mygr2-name = `readlink -f -n ../gr2` >> .hggrmapping
  $ hg add .hgguestrepo .hggrmapping
  $ hg commit -m 0
  $ cd ..

Test Pull with clone:
  $ cd host
  $ hg grpull
  cloning mygr1
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  cloning mygr2
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ..

Add new changeset to guest1 (not guest2)

  $ cd gr1
  $ echo c1 >> f
  $ hg commit -m "adding something"
  $ echo c1 >> f
  $ hg commit -m "adding something"
  $ cd ..


Test Pull with clone:
  $ cd host
  $ hg grin
  comparing with /tmp/cramtests-*/test-in.t/gr1 (glob)
  searching for changes
  changeset:   1:* (glob)
  user:        * (glob)
  date:        .+ (re)
  summary:     adding something
  
  changeset:   2:* (glob)
  tag:         tip
  user:        * (glob)
  date:        .+ (re)
  summary:     adding something
  
  comparing with /tmp/cramtests-*/test-in.t/gr2 (glob)
  searching for changes
  no changes found







  $ cd ..

clean up:
  $ cd $TESTDIR/host
  $ rm -rf many