Patchwork [STABLE] test-histedit: add tests for dropping head changeset

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 25, 2013, 4:33 p.m.
Message ID <4e53d143ad58d28632c6.1359131625@crater1.logilab.fr>
Download mbox | patch
Permalink /patch/733/
State Accepted
Commit 21daee53c10109e898fb9bb73bf07e0eacf79521
Headers show

Comments

Pierre-Yves David - Jan. 25, 2013, 4:33 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1358861597 -3600
# Branch stable
# Node ID 4e53d143ad58d28632c60bab54bd47db6bf46744
# Parent  692cbda1eb50fe30c70792cb1e9380b28769467c
test-histedit: add tests for dropping head changeset

I got bug report from user in this specific case. I was unable to reproduce in
test situation. Testing this situation is still valuable.
Pierre-Yves David - Jan. 25, 2013, 5:24 p.m.
On Fri, Jan 25, 2013 at 10:52:38AM -0600, Kevin Bullock wrote:
> On 25 Jan 2013, at 10:33 AM, pierre-yves.david@logilab.fr wrote:
> 
> > # HG changeset patch
> > # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> > # Date 1358861597 -3600
> > # Branch stable
> > # Node ID 4e53d143ad58d28632c60bab54bd47db6bf46744
> > # Parent  692cbda1eb50fe30c70792cb1e9380b28769467c
> > test-histedit: add tests for dropping head changeset
> > 
> > I got bug report from user in this specific case. I was unable to reproduce in
> > test situation. Testing this situation is still valuable.
> 
> Did that user submit the bug to our tracker? Did you? Even if we can't repro (yet), it should be in there.

No bug reported. The bug may have been already fixed I not eager to
create one before having at least one repro.
Augie Fackler - Jan. 27, 2013, 2:05 a.m.
(On tablet, sorry for top post)

What happens to a bookmark on the dropped change?
On Jan 25, 2013 12:24 PM, "Pierre-Yves David" <pierre-yves.david@logilab.fr>
wrote:

> On Fri, Jan 25, 2013 at 10:52:38AM -0600, Kevin Bullock wrote:
> > On 25 Jan 2013, at 10:33 AM, pierre-yves.david@logilab.fr wrote:
> >
> > > # HG changeset patch
> > > # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> > > # Date 1358861597 -3600
> > > # Branch stable
> > > # Node ID 4e53d143ad58d28632c60bab54bd47db6bf46744
> > > # Parent  692cbda1eb50fe30c70792cb1e9380b28769467c
> > > test-histedit: add tests for dropping head changeset
> > >
> > > I got bug report from user in this specific case. I was unable to
> reproduce in
> > > test situation. Testing this situation is still valuable.
> >
> > Did that user submit the bug to our tracker? Did you? Even if we can't
> repro (yet), it should be in there.
>
> No bug reported. The bug may have been already fixed I not eager to
> create one before having at least one repro.
>
> --
> Pierre-Yves David
>
> http://www.logilab.fr/
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAlECv9kACgkQElczi7p/bN+YgQCgib48KGIe983Uc4Fg5BkbY2Q8
> wnAAoKimuGCk+IP4uPa8D44roJ4k1arW
> =UX3M
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
>
Pierre-Yves David - Jan. 28, 2013, 10 a.m.
On Sat, Jan 26, 2013 at 09:05:05PM -0500, Augie Fackler wrote:
> (On tablet, sorry for top post)
> 
> What happens to a bookmark on the dropped change?

dropped changeset are properly registered as dropped by histedit. This dropped
information is used both to create obsolescence marker and compute next
bookmark location. Everything should be fine.

> On Jan 25, 2013 12:24 PM, "Pierre-Yves David" <pierre-yves.david@logilab.fr>
> wrote:
> 
> > On Fri, Jan 25, 2013 at 10:52:38AM -0600, Kevin Bullock wrote:
> > > On 25 Jan 2013, at 10:33 AM, pierre-yves.david@logilab.fr wrote:
> > >
> > > > # HG changeset patch
> > > > # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> > > > # Date 1358861597 -3600
> > > > # Branch stable
> > > > # Node ID 4e53d143ad58d28632c60bab54bd47db6bf46744
> > > > # Parent  692cbda1eb50fe30c70792cb1e9380b28769467c
> > > > test-histedit: add tests for dropping head changeset
> > > >
> > > > I got bug report from user in this specific case. I was unable to
> > reproduce in
> > > > test situation. Testing this situation is still valuable.
> > >
> > > Did that user submit the bug to our tracker? Did you? Even if we can't
> > repro (yet), it should be in there.
> >
> > No bug reported. The bug may have been already fixed I not eager to
> > create one before having at least one repro.
> >
> > --
> > Pierre-Yves David
> >
> > http://www.logilab.fr/
> >
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.10 (GNU/Linux)
> >
> > iEYEARECAAYFAlECv9kACgkQElczi7p/bN+YgQCgib48KGIe983Uc4Fg5BkbY2Q8
> > wnAAoKimuGCk+IP4uPa8D44roJ4k1arW
> > =UX3M
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
> >
> >

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - Jan. 31, 2013, 5:27 a.m.
On Fri, 2013-01-25 at 17:33 +0100, pierre-yves.david@logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1358861597 -3600
> # Branch stable
> # Node ID 4e53d143ad58d28632c60bab54bd47db6bf46744
> # Parent  692cbda1eb50fe30c70792cb1e9380b28769467c
> test-histedit: add tests for dropping head changeset

Queued for stable, thanks.

Patch

diff --git a/tests/test-histedit-drop.t b/tests/test-histedit-drop.t
--- a/tests/test-histedit-drop.t
+++ b/tests/test-histedit-drop.t
@@ -121,6 +121,38 @@  manifest after edit
   b
   d
   e
   f
 
+Drop the last changeset
+
+  $ cat > $EDITED <<EOF
+  > pick ee283cb5f2d5 e
+  > pick a4f7421b80f7 f
+  > drop f518305ce889 d
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit ee283cb5f2d5 2>&1 | fixbundle
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log --graph
+  @  changeset:   3:a4f7421b80f7
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:ee283cb5f2d5
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
   $ cd ..
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -151,10 +151,60 @@  Test that rewriting leaving instability 
 
 stabilise
 
   $ hg rebase  -r 'unstable()' -d .
 
+Test dropping of changeset on the top of the stack
+-------------------------------------------------------
+
+Nothing is rewritten below, the working directory parent must be change for the
+dropped changeset to be hidden.
+
+  $ cd ..
+  $ hg clone base droplast
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd droplast
+  $ cat > commands.txt <<EOF
+  > pick 40db8afa467b 10 c
+  > drop b449568bf7fc 11 f
+  > EOF
+  $ hg histedit -r '40db8afa467b' --commands commands.txt
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log -G
+  @  10:40db8afa467b c
+  |
+  o  0:cb9a9f314b8b a
+  
+
+With rewritten ancestors
+
+  $ echo e > e
+  $ hg add e
+  $ hg commit -m g
+  $ echo f > f
+  $ hg add f
+  $ hg commit -m h
+  $ cat > commands.txt <<EOF
+  > pick 47a8561c0449 12 g
+  > pick 40db8afa467b 10 c
+  > drop 1b3b05f35ff0 13 h
+  > EOF
+  $ hg histedit -r '40db8afa467b' --commands commands.txt
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  @  15:ee6544123ab8 c
+  |
+  o  14:269e713e9eae g
+  |
+  o  0:cb9a9f314b8b a
+  
+  $ cd ../base
+
+
 
 Test phases support
 ===========================================
 
 Check that histedit respect immutability