Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 1451:73eb4f33f9dc mercurial-3.3
tests: adapt the test for Mercurial 3.3
Some fix in the obsolete parent directory warning where also necessary.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 25 Jun 2015 17:22:17 -0700 |
parents | 9be1cadf7a07 |
children | 1bcbd14cf159 c79bdc856350 |
line wrap: on
line diff
--- a/hgext/evolve.py Thu Jun 25 16:55:27 2015 -0700 +++ b/hgext/evolve.py Thu Jun 25 17:22:17 2015 -0700 @@ -682,18 +682,16 @@ @eh.wrapcommand("pull") def wrapmayobsoletewc(origfn, ui, repo, *args, **opts): """Warn that the working directory parent is an obsolete changeset""" - def warnobsolete(): - if repo['.'].obsolete(): + + prior = (repo['.'].obsolete(), repo['.'].rev) + try: + res = origfn(ui, repo, *args, **opts) + finally: + after = (repo['.'].obsolete(), repo['.'].rev) + if prior != after and after[0]: ui.warn(_('working directory parent is obsolete!\n')) if (not ui.quiet) and obsolete.isenabled(repo, commandopt): ui.warn(_('(use "hg evolve" to update to its successor)\n')) - wlock = None - try: - wlock = repo.wlock() - repo._afterlock(warnobsolete) - res = origfn(ui, repo, *args, **opts) - finally: - lockmod.release(wlock) return res # XXX this could wrap transaction code