Patchwork [default-bug-fix] revert: stop marking file as clean after iterative revert (issue4592)

login
register
mail settings
Submitter Pierre-Yves David
Date April 11, 2015, 4:32 p.m.
Message ID <207e295aecc5bc8e728e.1428769948@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/8618/
State Accepted
Headers show

Comments

Pierre-Yves David - April 11, 2015, 4:32 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1428767649 14400
#      Sat Apr 11 11:54:09 2015 -0400
# Node ID 207e295aecc5bc8e728ec4c58674171167d034a5
# Parent  52ff737c63d2b2cb41185549aa9c35bc47317032
revert: stop marking file as clean after iterative revert (issue4592)

The goal of 'hg revert --interactive' is usually to keep some change in the
revert file, so they -must-not- be marked as clean. We want the status logic to
do his usual job here.

For unclear reason (probably timing related), I was unable to build an automated
test that reproduce issue4592 but manual test show this is fixed.
Augie Fackler - April 11, 2015, 6:05 p.m.
On Sat, Apr 11, 2015 at 12:32:28PM -0400, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1428767649 14400
> #      Sat Apr 11 11:54:09 2015 -0400
> # Node ID 207e295aecc5bc8e728ec4c58674171167d034a5
> # Parent  52ff737c63d2b2cb41185549aa9c35bc47317032
> revert: stop marking file as clean after iterative revert (issue4592)

Queued with some copyediting on the log message, thanks.

>
> The goal of 'hg revert --interactive' is usually to keep some change in the
> revert file, so they -must-not- be marked as clean. We want the status logic to
> do his usual job here.
>
> For unclear reason (probably timing related), I was unable to build an automated
> test that reproduce issue4592 but manual test show this is fixed.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -3121,15 +3121,10 @@ def _performrevert(repo, parents, ctx, a
>              try:
>                  patch.internalpatch(repo.ui, repo, fp, 1, eolmode=None)
>              except patch.PatchError, err:
>                  raise util.Abort(str(err))
>          del fp
> -
> -        for f in actions['revert'][0]:
> -            if normal:
> -                normal(f)
> -
>      else:
>          for f in actions['revert'][0]:
>              checkout(f)
>              if normal:
>                  normal(f)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3121,15 +3121,10 @@  def _performrevert(repo, parents, ctx, a
             try:
                 patch.internalpatch(repo.ui, repo, fp, 1, eolmode=None)
             except patch.PatchError, err:
                 raise util.Abort(str(err))
         del fp
-
-        for f in actions['revert'][0]:
-            if normal:
-                normal(f)
-
     else:
         for f in actions['revert'][0]:
             checkout(f)
             if normal:
                 normal(f)