Show More
@@ -84,7 +84,7 b' def write(repo):' | |||
|
84 | 84 | raise util.Abort(_("bookmark '%s' contains illegal " |
|
85 | 85 | "character" % mark)) |
|
86 | 86 | |
|
87 |
|
|
|
87 | lock = repo.lock() | |
|
88 | 88 | try: |
|
89 | 89 | |
|
90 | 90 | file = repo.opener('bookmarks', 'w', atomictemp=True) |
@@ -99,7 +99,7 b' def write(repo):' | |||
|
99 | 99 | pass |
|
100 | 100 | |
|
101 | 101 | finally: |
|
102 |
|
|
|
102 | lock.release() | |
|
103 | 103 | |
|
104 | 104 | def setcurrent(repo, mark): |
|
105 | 105 | '''Set the name of the bookmark that we are currently on |
@@ -117,13 +117,13 b' def setcurrent(repo, mark):' | |||
|
117 | 117 | raise util.Abort(_("bookmark '%s' contains illegal " |
|
118 | 118 | "character" % mark)) |
|
119 | 119 | |
|
120 |
|
|
|
120 | lock = repo.lock() | |
|
121 | 121 | try: |
|
122 | 122 | file = repo.opener('bookmarks.current', 'w', atomictemp=True) |
|
123 | 123 | file.write(encoding.fromlocal(mark)) |
|
124 | 124 | file.close() |
|
125 | 125 | finally: |
|
126 |
|
|
|
126 | lock.release() | |
|
127 | 127 | repo._bookmarkcurrent = mark |
|
128 | 128 | |
|
129 | 129 | def updatecurrentbookmark(repo, oldnode, curbranch): |
@@ -162,7 +162,7 b' def listbookmarks(repo):' | |||
|
162 | 162 | return d |
|
163 | 163 | |
|
164 | 164 | def pushbookmark(repo, key, old, new): |
|
165 |
|
|
|
165 | lock = repo.lock() | |
|
166 | 166 | try: |
|
167 | 167 | marks = repo._bookmarks |
|
168 | 168 | if hex(marks.get(key, '')) != old: |
@@ -176,7 +176,7 b' def pushbookmark(repo, key, old, new):' | |||
|
176 | 176 | write(repo) |
|
177 | 177 | return True |
|
178 | 178 | finally: |
|
179 |
|
|
|
179 | lock.release() | |
|
180 | 180 | |
|
181 | 181 | def updatefromremote(ui, repo, remote, path): |
|
182 | 182 | ui.debug("checking for updated bookmarks\n") |
@@ -279,7 +279,7 b' def clone(ui, peeropts, source, dest=Non' | |||
|
279 | 279 | if self.dir_: |
|
280 | 280 | self.rmtree(self.dir_, True) |
|
281 | 281 | |
|
282 | srclock = destlock = dircleanup = None | |
|
282 | srclock = destwlock = destlock = dircleanup = None | |
|
283 | 283 | try: |
|
284 | 284 | abspath = origsource |
|
285 | 285 | if islocal(origsource): |
@@ -325,6 +325,11 b' def clone(ui, peeropts, source, dest=Non' | |||
|
325 | 325 | # we need to re-init the repo after manually copying the data |
|
326 | 326 | # into it |
|
327 | 327 | destrepo = repository(remoteui(ui, peeropts), dest) |
|
328 | # we need full recursive locking of the new repo instance | |
|
329 | destwlock = destrepo.wlock() | |
|
330 | if destlock: | |
|
331 | destlock.release() # a little race condition - but no deadlock | |
|
332 | destlock = destrepo.lock() | |
|
328 | 333 | srcrepo.hook('outgoing', source='clone', |
|
329 | 334 | node=node.hex(node.nullid)) |
|
330 | 335 | else: |
@@ -401,7 +406,7 b' def clone(ui, peeropts, source, dest=Non' | |||
|
401 | 406 | |
|
402 | 407 | return srcrepo, destrepo |
|
403 | 408 | finally: |
|
404 | release(srclock, destlock) | |
|
409 | release(srclock, destlock, destwlock) | |
|
405 | 410 | if dircleanup is not None: |
|
406 | 411 | dircleanup.cleanup() |
|
407 | 412 |
General Comments 0
You need to be logged in to leave comments.
Login now