Mercurial > hg
comparison hgext/shelve.py @ 24704:03f92741487f
shelve: acquire lock in the right order
Text book says that 'wlock' should be acquired before 'lock'.
Caught through developer warning.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 12 Apr 2015 14:59:31 -0400 |
parents | 95cbc77c0cad |
children | 3510ec97ffdc |
comparison
equal
deleted
inserted
replaced
24703:868cec6409c4 | 24704:03f92741487f |
---|---|
542 raise util.Abort(_("shelved change '%s' not found") % basename) | 542 raise util.Abort(_("shelved change '%s' not found") % basename) |
543 | 543 |
544 oldquiet = ui.quiet | 544 oldquiet = ui.quiet |
545 wlock = lock = tr = None | 545 wlock = lock = tr = None |
546 try: | 546 try: |
547 wlock = repo.wlock() | |
547 lock = repo.lock() | 548 lock = repo.lock() |
548 wlock = repo.wlock() | |
549 | 549 |
550 tr = repo.transaction('unshelve', report=lambda x: None) | 550 tr = repo.transaction('unshelve', report=lambda x: None) |
551 oldtiprev = len(repo) | 551 oldtiprev = len(repo) |
552 | 552 |
553 pctx = repo['.'] | 553 pctx = repo['.'] |