[Updated] D12415: revert: use a `continue` to reduce indentation

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Apr 6 12:51:37 UTC 2022


Closed by commit rHG9be7da341885: revert: use a `continue` to reduce indentation (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12415?vs=32722&id=32814

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12415/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D12415

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3749,10 +3749,12 @@
 
     for f in actions[b'add'][0]:
         # Don't checkout modified files, they are already created by the diff
-        if f not in newlyaddedandmodifiedfiles:
-            prntstatusmsg(b'add', f)
-            checkout(f)
-            repo.dirstate.set_tracked(f)
+        if f in newlyaddedandmodifiedfiles:
+            continue
+
+        prntstatusmsg(b'add', f)
+        checkout(f)
+        repo.dirstate.set_tracked(f)
 
     for f in actions[b'undelete'][0]:
         if interactive:



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220406/20fc7652/attachment-0002.html>


More information about the Mercurial-patches mailing list