changeset 33360:4a70985805c6

identify: simplify the dirty check This is equivalent to the previous code, but it seems better to be explicit about what aspects of dirty are being ignored. Perhaps they shouldn't be, since the help text says 'followed by a "+" if the working directory has uncommitted changes'. Both merges and branch changes are committable, even if the files are unchanged. Additionally, this will make the `identify` command notice missing subrepo files, once subrepos are taught to look for missing files.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Jul 2017 00:19:03 -0400
parents 583aa1e3658b
children 66fe60d5f291
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Jul 09 00:05:31 2017 -0400
+++ b/mercurial/commands.py	Sun Jul 09 00:19:03 2017 -0400
@@ -2775,8 +2775,7 @@
                 taglist.extend(p.tags())
 
             dirty = ""
-            if (any(repo.status())
-                or any(ctx.sub(s).dirty() for s in ctx.substate)):
+            if ctx.dirty(missing=True, merge=False, branch=False):
                 dirty = '+'
             fm.data(dirty=dirty)