changeset 22417:ca854cd4a26a

commit: correctly check commit mutability during commit --amend The right way to check if a context is mutable is to call .mutable(), not to compare .phase() with public.
author Augie Fackler <raf@durin42.com>
date Tue, 19 Aug 2014 14:33:31 -0400
parents 810d37485e85
children 192c798aabee
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Aug 19 14:33:01 2014 -0400
+++ b/mercurial/commands.py	Tue Aug 19 14:33:31 2014 -0400
@@ -1409,7 +1409,7 @@
             raise util.Abort(_('cannot amend with ui.commitsubrepos enabled'))
 
         old = repo['.']
-        if old.phase() == phases.public:
+        if not old.mutable():
             raise util.Abort(_('cannot amend public changesets'))
         if len(repo[None].parents()) > 1:
             raise util.Abort(_('cannot amend while merging'))