mercurial/commands.py
changeset 840 141744605b51
parent 839 9c918287d10b
child 841 03cc2ba291d1
equal deleted inserted replaced
839:9c918287d10b 840:141744605b51
  1038     cwd = repo.getcwd()
  1038     cwd = repo.getcwd()
  1039     files, matchfn = matchpats(cwd, pats, opts)
  1039     files, matchfn = matchpats(cwd, pats, opts)
  1040     (c, a, d, u) = [[pathto(cwd, x) for x in n]
  1040     (c, a, d, u) = [[pathto(cwd, x) for x in n]
  1041                     for n in repo.changes(files=files, match=matchfn)]
  1041                     for n in repo.changes(files=files, match=matchfn)]
  1042 
  1042 
  1043     for f in c:
  1043     filetype = "";
  1044         ui.write("M ", f, "\n")
  1044     if opts['modified']: filetype += "M";
  1045     for f in a:
  1045     if opts[   'added']: filetype += "A";
  1046         ui.write("A ", f, "\n")
  1046     if opts[ 'removed']: filetype += "R";
  1047     for f in d:
  1047     if opts[ 'unknown']: filetype += "?";
  1048         ui.write("R ", f, "\n")
  1048     if filetype == "" : filetype = "MAR?"
  1049     for f in u:
  1049     
  1050         ui.write("? ", f, "\n")
  1050     for key, value in zip(["M", "A", "R", "?"], (c, a, d, u)):
       
  1051         if value and filetype.find(key) >= 0:
       
  1052             for f in value:
       
  1053                 ui.write("%s " % key, f, "\n")
  1051 
  1054 
  1052 def tag(ui, repo, name, rev=None, **opts):
  1055 def tag(ui, repo, name, rev=None, **opts):
  1053     """add a tag for the current tip or a given revision"""
  1056     """add a tag for the current tip or a given revision"""
  1054     if opts['text']:
  1057     if opts['text']:
  1055         ui.warn("Warning: -t and --text is deprecated,"
  1058         ui.warn("Warning: -t and --text is deprecated,"
  1259           ('n', 'name', os.getcwd(), 'repository name'),
  1262           ('n', 'name', os.getcwd(), 'repository name'),
  1260           ('', 'stdio', None, 'for remote clients'),
  1263           ('', 'stdio', None, 'for remote clients'),
  1261           ('t', 'templates', "", 'template map'),
  1264           ('t', 'templates', "", 'template map'),
  1262           ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')],
  1265           ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')],
  1263          "hg serve [OPTION]..."),
  1266          "hg serve [OPTION]..."),
  1264     "^status": (status,
  1267     "^status":
  1265                 [('I', 'include', [], 'include path in search'),
  1268         (status,
  1266                  ('X', 'exclude', [], 'exclude path from search')],
  1269          [('m', 'modified', None, 'show only modified files'),
  1267                 'hg status [FILE]...'),
  1270           ('a', 'added', None, 'show only added files'),
       
  1271           ('r', 'removed', None, 'show only removed files'),
       
  1272           ('u', 'unknown', None, 'show only unknown (not tracked) files'),
       
  1273           ('I', 'include', [], 'include path in search'),
       
  1274           ('X', 'exclude', [], 'exclude path from search')],
       
  1275          "hg status [FILE]..."),
  1268     "tag":
  1276     "tag":
  1269         (tag,
  1277         (tag,
  1270          [('l', 'local', None, 'make the tag local'),
  1278          [('l', 'local', None, 'make the tag local'),
  1271           ('m', 'message', "", 'commit message'),
  1279           ('m', 'message', "", 'commit message'),
  1272           ('t', 'text', "", 'commit message (deprecated: use -m)'),
  1280           ('t', 'text', "", 'commit message (deprecated: use -m)'),