comparison mercurial/commands.py @ 842:8fb488773063

Rewritten change type selection for hg status.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 06 Aug 2005 12:05:09 +0100
parents 03cc2ba291d1
children 859e7ea530bd
comparison
equal deleted inserted replaced
841:03cc2ba291d1 842:8fb488773063
1031 '''show changed files in the working directory 1031 '''show changed files in the working directory
1032 1032
1033 M = modified 1033 M = modified
1034 A = added 1034 A = added
1035 R = removed 1035 R = removed
1036 ? = not tracked''' 1036 ? = not tracked
1037 '''
1037 1038
1038 cwd = repo.getcwd() 1039 cwd = repo.getcwd()
1039 files, matchfn = matchpats(cwd, pats, opts) 1040 files, matchfn = matchpats(cwd, pats, opts)
1040 (c, a, d, u) = [[pathto(cwd, x) for x in n] 1041 (c, a, d, u) = [[pathto(cwd, x) for x in n]
1041 for n in repo.changes(files=files, match=matchfn)] 1042 for n in repo.changes(files=files, match=matchfn)]
1042 1043
1043 filetype = ""; 1044 changetypes = [('modified', 'M', c),
1044 if opts['modified']: filetype += "M"; 1045 ('added', 'A', a),
1045 if opts[ 'added']: filetype += "A"; 1046 ('removed', 'R', d),
1046 if opts[ 'removed']: filetype += "R"; 1047 ('unknown', '?', u)]
1047 if opts[ 'unknown']: filetype += "?"; 1048
1048 if filetype == "" : filetype = "MAR?" 1049 for opt, char, changes in ([ct for ct in changetypes if opts[ct[0]]]
1049 1050 or changetypes):
1050 for key, value in zip(["M", "A", "R", "?"], (c, a, d, u)): 1051 for f in changes:
1051 if value and filetype.find(key) >= 0: 1052 ui.write("%s %s\n" % (char, f))
1052 for f in value:
1053 ui.write("%s " % key, f, "\n")
1054 1053
1055 def tag(ui, repo, name, rev=None, **opts): 1054 def tag(ui, repo, name, rev=None, **opts):
1056 """add a tag for the current tip or a given revision""" 1055 """add a tag for the current tip or a given revision"""
1057 if opts['text']: 1056 if opts['text']:
1058 ui.warn("Warning: -t and --text is deprecated," 1057 ui.warn("Warning: -t and --text is deprecated,"