Source

guestrepo / tests / test-freeze.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
  $ TESTDIR=`pwd`

Make a host and guest repo
  $ hg init gr
  $ cd gr
  $ echo c0 > f
  $ hg add f
  $ hg commit -m 0

  $ cd $TESTDIR
  $ hg init host
  $ cd host
  $ echo mygr = mygr-name default >> .hgguestrepo
  $ echo mygr-name = `readlink -f -n ../gr` >> .hggrmapping
  $ hg add .hgguestrepo .hggrmapping
  $ hg commit -m 0

  $ hg grupdate
  cloning mygr
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Run freeze and test that it rewrote and commited
  $ hg grfreeze
  $ cat .hgguestrepo
  mygr       = mygr-name  ???????????????????????????????????????? (glob)

State should have the same output as freeze
  $ hg grstate
  mygr       = mygr-name  ???????????????????????????????????????? (glob)