mercurial/commands.py
changeset 8152 08e1baf924ca
parent 8150 bbc24c0753a0
child 8182 b97abc7c1135
equal deleted inserted replaced
8151:127281884959 8152:08e1baf924ca
  1478         try:
  1478         try:
  1479             ct = mod.cmdtable
  1479             ct = mod.cmdtable
  1480         except AttributeError:
  1480         except AttributeError:
  1481             ct = {}
  1481             ct = {}
  1482 
  1482 
  1483         modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
  1483         modcmds = set([c.split('|', 1)[0] for c in ct])
  1484         helplist(_('list of commands:\n\n'), modcmds.has_key)
  1484         helplist(_('list of commands:\n\n'), modcmds.__contains__)
  1485 
  1485 
  1486     if name and name != 'shortlist':
  1486     if name and name != 'shortlist':
  1487         i = None
  1487         i = None
  1488         for f in (helptopic, helpcmd, helpext):
  1488         for f in (helptopic, helpcmd, helpext):
  1489             try:
  1489             try:
  2501             if abs not in names:
  2501             if abs not in names:
  2502                 names[abs] = m.rel(abs), m.exact(abs)
  2502                 names[abs] = m.rel(abs), m.exact(abs)
  2503 
  2503 
  2504         m = cmdutil.matchfiles(repo, names)
  2504         m = cmdutil.matchfiles(repo, names)
  2505         changes = repo.status(match=m)[:4]
  2505         changes = repo.status(match=m)[:4]
  2506         modified, added, removed, deleted = map(dict.fromkeys, changes)
  2506         modified, added, removed, deleted = map(set, changes)
  2507 
  2507 
  2508         # if f is a rename, also revert the source
  2508         # if f is a rename, also revert the source
  2509         cwd = repo.getcwd()
  2509         cwd = repo.getcwd()
  2510         for f in added:
  2510         for f in added:
  2511             src = repo.dirstate.copied(f)
  2511             src = repo.dirstate.copied(f)
  2512             if src and src not in names and repo.dirstate[src] == 'r':
  2512             if src and src not in names and repo.dirstate[src] == 'r':
  2513                 removed[src] = None
  2513                 removed.add(src)
  2514                 names[src] = (repo.pathto(src, cwd), True)
  2514                 names[src] = (repo.pathto(src, cwd), True)
  2515 
  2515 
  2516         def removeforget(abs):
  2516         def removeforget(abs):
  2517             if repo.dirstate[abs] == 'a':
  2517             if repo.dirstate[abs] == 'a':
  2518                 return _('forgetting %s\n')
  2518                 return _('forgetting %s\n')
  2822     See 'hg help dates' for a list of formats valid for -d/--date.
  2822     See 'hg help dates' for a list of formats valid for -d/--date.
  2823     """
  2823     """
  2824 
  2824 
  2825     rev_ = "."
  2825     rev_ = "."
  2826     names = (name1,) + names
  2826     names = (name1,) + names
  2827     if len(names) != len(dict.fromkeys(names)):
  2827     if len(names) != len(set(names)):
  2828         raise util.Abort(_('tag names must be unique'))
  2828         raise util.Abort(_('tag names must be unique'))
  2829     for n in names:
  2829     for n in names:
  2830         if n in ['tip', '.', 'null']:
  2830         if n in ['tip', '.', 'null']:
  2831             raise util.Abort(_('the name \'%s\' is reserved') % n)
  2831             raise util.Abort(_('the name \'%s\' is reserved') % n)
  2832     if opts.get('rev') and opts.get('remove'):
  2832     if opts.get('rev') and opts.get('remove'):