changeset 40580:ab893a99b645

phases: add a list of names usable by the phase command This is useful in TortoiseHg for example, which has until recently just added all names in the `phasenames` list to the context menu that changes the phase. The ones not supported by the command would just error out.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 09 Nov 2018 23:19:53 -0500
parents aca09df32819
children ef694e477783
files mercurial/phases.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/phases.py	Wed Nov 07 19:59:38 2018 +0100
+++ b/mercurial/phases.py	Fri Nov 09 23:19:53 2018 -0500
@@ -133,8 +133,9 @@
 allphases = range(internal + 1)
 trackedphases = allphases[1:]
 # record phase names
+cmdphasenames = ['public', 'draft', 'secret']  # known to `hg phase` command
 phasenames = [None] * len(allphases)
-phasenames[:3] = ['public', 'draft', 'secret']
+phasenames[:len(cmdphasenames)] = cmdphasenames
 phasenames[archived] = 'archived'
 phasenames[internal] = 'internal'
 # record phase property