[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    strip + subrepos
From:       Aurélien_Campéas <aurelien.campeas () logilab ! fr>
Date:       2012-02-29 10:14:34
Message-ID: 4F4DFA8A.8080603 () logilab ! fr
[Download RAW message or body]

Hi list,

While learning subrepos I went into the following pb:

* subrepo contains some dirty state
* master repo is stripped
* subrepo is reset to its master/.hgsubstate defined state, without warning

FTR, without subrepos, the strip command bails out if local changes are 
found.

Should I open a ticket ?

Regards,
Aurélien.


PS: here comes a test

   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH

Creating a "sub" repo with two revisions

   $ hg init sub
   $ cd sub
   $ hg log
   $ touch stuff
   $ hg add stuff
   $ hg ci -m 'define stuff'
   $ echo 'stuffed' > stuff
   $ hg ci -m 'stuff it'

Creating a "master" repo with "sub" inside

   $ cd ..
   $ hg init master
   $ cd master
   $ echo 'sub = sub' > .hgsub
   $ ln -s ../sub
   $ hg add .hgsub
   $ hg ci -m 'recorded sub'
   committing subrepository

Updating "sub" to rev 0

   $ cd sub
   $ hg up 0
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat stuff

Putting a tag on "master"

   $ cd ..
   $ hg tag fancy-tag-name

Ooops what a mistake

   $ hg strip 1
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to 
$TESTTMP/master/.hg/strip-backup/baa01ba6b66a-backup.hg

Here I expect the "sub" repo state to be still at revision 0, but ...

   $ cd sub
   $ cat stuff
   stuffed

And now for something completely different: let's introduce dirty state 
in the "sub"
and see how strip reacts

   $ echo "foo" > stuff
   $ cd ..
   $ hg tag anothertag
   $ hg strip 1
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to 
$TESTTMP/master/.hg/strip-backup/b3bf199e3693-backup.hg
   $ cd sub
   $ cat stuff
   stuffed


_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic