Patchwork D8464: locking: wait for locks in `hg cp` and `hg mv`

login
register
mail settings
Submitter phabricator
Date April 21, 2020, 8:50 p.m.
Message ID <differential-rev-PHID-DREV-gberrt2c65k2ab4jc3cu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46194/
State Superseded
Headers show

Comments

phabricator - April 21, 2020, 8:50 p.m.
spectral created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I traced this back to revision 1822 (64df422 <https://phab.mercurial-scm.org/rHG64df4220b34998ea0ff1280035ffcd1c0fb665b1>), and there's no explanation why we
  would prefer to error out instead of waiting for the locks.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2350,7 +2350,7 @@ 
     Returns 0 on success, 1 if errors are encountered.
     """
     opts = pycompat.byteskwargs(opts)
-    with repo.wlock(False):
+    with repo.wlock():
         return cmdutil.copy(ui, repo, pats, opts)
 
 
@@ -5807,7 +5807,7 @@ 
     Returns 0 on success, 1 if errors are encountered.
     """
     opts = pycompat.byteskwargs(opts)
-    with repo.wlock(False):
+    with repo.wlock():
         return cmdutil.copy(ui, repo, pats, opts, rename=True)