[BUG] new extension: localbranch

Guido Ostkamp hg at ostkamp.fastmail.fm
Thu Aug 30 16:31:23 CDT 2007


>>> It's a very young extension, and probably still very buggy. Feedback 
>>> is appreciated, but please don't store anything vital exclusively in a 
>>> local branch yet.

I think I detected a bug in the localbranch:

When I create a repository with some content, then create a test branch, 
change and commit something, switch back to default branch, add a new file 
commit and switch back to the test branch and update to tip, the new file
created in default branch is not being deleted though it should not be there.

What do you think?

Possibly there are similar problems in opposite direction, I didn't check.

Example:

$ mkdir repo
$ cd repo
$ hg init
$ echo "line" > file
$ hg add file
$ hg commit -m 'initial checkin' file
$ hg lbranch
* default
$ hg lbranch test
$ hg lbranch
default
* test
$ echo "line 2" > file
$ hg commit -m "checkin in branch test" file
$ hg log
changeset:   1:b69b76287fea
tag:         tip
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:19:13 2007 +0200
summary:     checkin in branch test

changeset:   0:fed9627e31a0
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:18:36 2007 +0200
summary:     initial checkin

$ hg lbranch default
$ hg lbranch
* default
test
$ hg up -C
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat file
line
$ # OK here, we see the old contents of file after switching back
$ # to default
$ echo "new file" > file2
$ hg add file2
$ hg commit -m 'introduced new file' file2
$ hg log
changeset:   1:bf837e02e875
tag:         tip
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:20:03 2007 +0200
summary:     introduced new file

changeset:   0:fed9627e31a0
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:18:36 2007 +0200
summary:     initial checkin

$ hg lbranch
* default
test
$ hg lbranch test
$ hg up -C
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg log
changeset:   1:b69b76287fea
tag:         tip
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:19:13 2007 +0200
summary:     checkin in branch test

changeset:   0:fed9627e31a0
user:        ostkamp at bianca.dialin.t-online.de
date:        Thu Aug 30 23:18:36 2007 +0200
summary:     initial checkin

$ # Here we should no longer see file2
$ ls
file  file2
m$ cat file2
new file
$

Regards

Guido


More information about the Mercurial-devel mailing list