[PATCH 4 of 4 V5] histedit: ignores hidden revision when checking for orphaned nodes

Augie Fackler raf at durin42.com
Fri Oct 12 16:17:43 CDT 2012


queueing all 4 of these with a slight spelling fix in patch 4.

On Oct 11, 2012, at 1:48 AM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1348747252 -7200
> # Node ID d23c9738da3c5b493eaac557afb2988a5ec6af7c
> # Parent  d34351f9cb06bf64ea1dc9b9b2936fec02be8d5e
> histedit: ignores hidden revision when checking for orphaned nodes
> 
> We do not want hidden revision to block histedit. They are already "dead"
> and we do not care about dead orphan. see similare changeset 9e2dc0d292cd for
> rebase.
> 
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -588,7 +588,7 @@
> 
>     When keep is false, the specified set can't have children."""
>     revs = list(repo.set('%n::%n', old, new))
> -    if not keep and repo.revs('(%ld::) - %ld', revs, revs):
> +    if not keep and repo.revs('(%ld::) - (%ld + hidden())', revs, revs):
>         raise util.Abort(_('cannot edit history that would orphan nodes'))
>     return [c.node() for c in revs]
> 
> 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
> @@ -92,3 +92,32 @@
>   d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '*', 'user': 'test'} (glob)
>   055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*': 'test'} (glob)
>   177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '*', 'user': 'test'} (glob)
> +
> +Ensure hidden revision does not prevent histedit
> +-------------------------------------------------
> +
> +create an hidden revision
> +
> +  $ cat > commands.txt <<EOF
> +  > pick d36c0562f908 6 c
> +  > drop ae467701c500 7 d
> +  > pick 0efacef7cb48 8 f
> +  > EOF
> +  $ hg histedit 6 --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
> +  $ hg log --graph
> +  @  9:7c044e3e33a9 f
> +  |
> +  o  6:d36c0562f908 c
> +  |
> +  o  0:cb9a9f314b8b a
> +  
> +check hidden revision are ignored (6 have hidden children 7 and 8)
> +
> +  $ cat > commands.txt <<EOF
> +  > pick d36c0562f908 6 c
> +  > pick 7c044e3e33a9 8 f
> +  > EOF
> +  $ hg histedit 6 --commands commands.txt
> +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved



More information about the Mercurial-devel mailing list