153 tr.release() |
153 tr.release() |
154 |
154 |
155 def _createmarkers(orig, repo, relations, flag=0, date=None, metadata=None): |
155 def _createmarkers(orig, repo, relations, flag=0, date=None, metadata=None): |
156 """wrap markers create to make sure we de-inhibit target nodes""" |
156 """wrap markers create to make sure we de-inhibit target nodes""" |
157 # wrapping transactio to unify the one in each function |
157 # wrapping transactio to unify the one in each function |
158 tr = repo.transaction('add-obsolescence-marker') |
158 lock = tr = None |
159 try: |
159 try: |
|
160 lock = repo.lock() |
|
161 tr = repo.transaction('add-obsolescence-marker') |
160 orig(repo, relations, flag, date, metadata) |
162 orig(repo, relations, flag, date, metadata) |
161 precs = (r[0].node() for r in relations) |
163 precs = (r[0].node() for r in relations) |
162 _deinhibitmarkers(repo, precs) |
164 _deinhibitmarkers(repo, precs) |
163 tr.close() |
165 tr.close() |
164 finally: |
166 finally: |
165 tr.release() |
167 lockmod.release(tr, lock) |
166 |
168 |
167 def transactioncallback(orig, repo, *args, **kwargs): |
169 def transactioncallback(orig, repo, *args, **kwargs): |
168 """ Wrap localrepo.transaction to inhibit new obsolete changes """ |
170 """ Wrap localrepo.transaction to inhibit new obsolete changes """ |
169 def inhibitposttransaction(transaction): |
171 def inhibitposttransaction(transaction): |
170 # At the end of the transaction we catch all the new visible and |
172 # At the end of the transaction we catch all the new visible and |