Show More
@@ -13,6 +13,7 b' import shutil' | |||
|
13 | 13 | |
|
14 | 14 | from mercurial import util, match as match_, hg, node, context, error, cmdutil |
|
15 | 15 | from mercurial.i18n import _ |
|
16 | from mercurial.lock import release | |
|
16 | 17 | |
|
17 | 18 | import lfutil |
|
18 | 19 | import basestore |
@@ -54,10 +55,12 b' def lfconvert(ui, src, dest, *pats, **op' | |||
|
54 | 55 | rdst = hg.repository(ui, dest, create=True) |
|
55 | 56 | |
|
56 | 57 | success = False |
|
58 | dstwlock = dstlock = None | |
|
57 | 59 | try: |
|
58 | 60 | # Lock destination to prevent modification while it is converted to. |
|
59 | 61 | # Don't need to lock src because we are just reading from its history |
|
60 | 62 | # which can't change. |
|
63 | dstwlock = rdst.wlock() | |
|
61 | 64 | dstlock = rdst.lock() |
|
62 | 65 | |
|
63 | 66 | # Get a list of all changesets in the source. The easy way to do this |
@@ -110,10 +113,11 b' def lfconvert(ui, src, dest, *pats, **op' | |||
|
110 | 113 | ui.progress(_('converting revisions'), None) |
|
111 | 114 | success = True |
|
112 | 115 | finally: |
|
116 | rdst.dirstate.clear() | |
|
117 | release(dstlock, dstwlock) | |
|
113 | 118 | if not success: |
|
114 | 119 | # we failed, remove the new directory |
|
115 | 120 | shutil.rmtree(rdst.root) |
|
116 | dstlock.release() | |
|
117 | 121 | |
|
118 | 122 | def _addchangeset(ui, rsrc, rdst, ctx, revmap): |
|
119 | 123 | # Convert src parents to dst parents |
General Comments 0
You need to be logged in to leave comments.
Login now