Source

guestrepo / tests / test-dirtyupdate.t

The default branch has multiple heads

Full commit
# 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 a guest repo:
  $ mkdir gr1
  $ cd gr1
  $ hg init
  $ echo c0 > f
  $ hg add f
  $ hg commit -m 0
  $ cd ..

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

Test when host is modified:
  $ echo change > f
  $ hg grupdate
  abort: repository /tmp/*/test-dirtyupdate.t/host contains uncommitted changes (glob)
  [255]

Test when deleted
  $ rm f
  $ hg grupdate
  abort: repository /tmp/*/test-dirtyupdate.t/host contains uncommitted changes (glob)
  [255]

Test when removed
  $ hg up -C
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg remove f
  $ hg grupdate
  abort: repository /tmp/*/test-dirtyupdate.t/host contains uncommitted changes (glob)
  [255]

Test when added
  $ hg up -C
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ touch f2
  $ hg add f2
  $ hg grupdate
  abort: repository /tmp/*/test-dirtyupdate.t/host contains uncommitted changes (glob)
  [255]

Clone child
  $ hg up -C
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg grupdate
  cloning mygr1
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Test recursive behavior
  $ hg up -C
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo changed > mygr1/f
  $ hg grupdate
  abort: repository /tmp/*/test-dirtyupdate.t/host/mygr1 contains uncommitted changes (glob)
  [255]