comparison mercurial/commands.py @ 43646:1e1bad31b427

commands: use field names instead of field numbers on scmutil.status As part of my pytype adventures I want to make scmutil.status no longer a subclass of tuple. This is part of that process. Differential Revision: https://phab.mercurial-scm.org/D7398
author Augie Fackler <augie@google.com>
date Thu, 14 Nov 2019 15:27:32 -0500
parents 95d0532ad171
children f37da59a36d9
comparison
equal deleted inserted replaced
43645:9cb7f855e2fc 43646:1e1bad31b427
2114 2114
2115 node = cmdutil.commit(ui, repo, commitfunc, pats, opts) 2115 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
2116 2116
2117 if not node: 2117 if not node:
2118 stat = cmdutil.postcommitstatus(repo, pats, opts) 2118 stat = cmdutil.postcommitstatus(repo, pats, opts)
2119 if stat[3]: 2119 if stat.deleted:
2120 ui.status( 2120 ui.status(
2121 _( 2121 _(
2122 b"nothing changed (%d missing files, see " 2122 b"nothing changed (%d missing files, see "
2123 b"'hg status')\n" 2123 b"'hg status')\n"
2124 ) 2124 )
2125 % len(stat[3]) 2125 % len(stat.deleted)
2126 ) 2126 )
2127 else: 2127 else:
2128 ui.status(_(b"nothing changed\n")) 2128 ui.status(_(b"nothing changed\n"))
2129 return 1 2129 return 1
2130 2130
6851 b'clean' in show, 6851 b'clean' in show,
6852 b'unknown' in show, 6852 b'unknown' in show,
6853 opts.get(b'subrepos'), 6853 opts.get(b'subrepos'),
6854 ) 6854 )
6855 6855
6856 changestates = zip(states, pycompat.iterbytestr(b'MAR!?IC'), stat) 6856 changestates = zip(
6857 states,
6858 pycompat.iterbytestr(b'MAR!?IC'),
6859 [getattr(stat, s.decode('utf8')) for s in states],
6860 )
6857 6861
6858 copy = {} 6862 copy = {}
6859 if ( 6863 if (
6860 opts.get(b'all') 6864 opts.get(b'all')
6861 or opts.get(b'copies') 6865 or opts.get(b'copies')