Skip to content
Snippets Groups Projects
Commit 1eede2ea2041 authored by kiilerix's avatar kiilerix
Browse files

largefiles: use wlock for lfconvert (issue3444)

largefiles and lfconvert do dirty hacks with dirstate, so to avoid writing that
as a side effect of the wlock release we clear dirstate first.

To avoid confusing lock validation algorithms in error situations we unlock
_before_ removing the target directory.
parent 40cdf8bc8d40
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
from mercurial import util, match as match_, hg, node, context, error, cmdutil
from mercurial.i18n import _
from mercurial.lock import release
import lfutil
import basestore
......@@ -54,7 +55,8 @@
rdst = hg.repository(ui, dest, create=True)
success = False
dstwlock = dstlock = None
try:
# Lock destination to prevent modification while it is converted to.
# Don't need to lock src because we are just reading from its history
# which can't change.
......@@ -57,7 +59,8 @@
try:
# Lock destination to prevent modification while it is converted to.
# Don't need to lock src because we are just reading from its history
# which can't change.
dstwlock = rdst.wlock()
dstlock = rdst.lock()
# Get a list of all changesets in the source. The easy way to do this
......@@ -110,6 +113,8 @@
ui.progress(_('converting revisions'), None)
success = True
finally:
rdst.dirstate.clear()
release(dstlock, dstwlock)
if not success:
# we failed, remove the new directory
shutil.rmtree(rdst.root)
......@@ -113,7 +118,6 @@
if not success:
# we failed, remove the new directory
shutil.rmtree(rdst.root)
dstlock.release()
def _addchangeset(ui, rsrc, rdst, ctx, revmap):
# Convert src parents to dst parents
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment