Patchwork [4,of,4] revert: drop dead code about untracked file

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 18, 2014, 11:36 p.m.
Message ID <0ffbbdae0528fceaf4a2.1408405013@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5485/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 18, 2014, 11:36 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1403650937 -3600
#      Wed Jun 25 00:02:17 2014 +0100
# Node ID 0ffbbdae0528fceaf4a263da2d4f3829193973f4
# Parent  cbdd2b77da8097c37c5a93733b4870e15294c93d
revert: drop dead code about untracked file

Untracked file are handled through status now.
Augie Fackler - Aug. 19, 2014, 12:02 a.m.
On Mon, Aug 18, 2014 at 04:36:53PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1403650937 -3600
> #      Wed Jun 25 00:02:17 2014 +0100
> # Node ID 0ffbbdae0528fceaf4a263da2d4f3829193973f4
> # Parent  cbdd2b77da8097c37c5a93733b4870e15294c93d
> revert: drop dead code about untracked file

series queued, thanks

>
> Untracked file are handled through status now.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2519,18 +2519,10 @@ def revert(ui, repo, ctx, parents, *pats
>                              msg = msg(abs)
>                          ui.status(msg % rel)
>                  elif exact:
>                          ui.warn(msg % rel)
>                  break
> -            else:
> -                # Not touched in current dirstate.
> -
> -                # file is unknown in parent, restore older version or ignore.
> -                if abs not in repo.dirstate:
> -                    if exact:
> -                        ui.warn(_('file not managed: %s\n') % rel)
> -                    continue
>
>
>          if not opts.get('dry_run'):
>              _performrevert(repo, parents, ctx, actions)
>
> _______________________________________________
> 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
@@ -2519,18 +2519,10 @@  def revert(ui, repo, ctx, parents, *pats
                             msg = msg(abs)
                         ui.status(msg % rel)
                 elif exact:
                         ui.warn(msg % rel)
                 break
-            else:
-                # Not touched in current dirstate.
-
-                # file is unknown in parent, restore older version or ignore.
-                if abs not in repo.dirstate:
-                    if exact:
-                        ui.warn(_('file not managed: %s\n') % rel)
-                    continue
 
 
         if not opts.get('dry_run'):
             _performrevert(repo, parents, ctx, actions)