mercurial/debugcommands.py
changeset 41636 be8741d42836
parent 41515 7dc160a57025
child 41659 ecf7f4ef52fb
equal deleted inserted replaced
41635:446e1dcc3b5c 41636:be8741d42836
  1084     if not files:
  1084     if not files:
  1085         # Show all the patterns
  1085         # Show all the patterns
  1086         ui.write("%s\n" % pycompat.byterepr(ignore))
  1086         ui.write("%s\n" % pycompat.byterepr(ignore))
  1087     else:
  1087     else:
  1088         m = scmutil.match(repo[None], pats=files)
  1088         m = scmutil.match(repo[None], pats=files)
       
  1089         uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
  1089         for f in m.files():
  1090         for f in m.files():
  1090             nf = util.normpath(f)
  1091             nf = util.normpath(f)
  1091             ignored = None
  1092             ignored = None
  1092             ignoredata = None
  1093             ignoredata = None
  1093             if nf != '.':
  1094             if nf != '.':
  1100                             ignored = p
  1101                             ignored = p
  1101                             ignoredata = repo.dirstate._ignorefileandline(p)
  1102                             ignoredata = repo.dirstate._ignorefileandline(p)
  1102                             break
  1103                             break
  1103             if ignored:
  1104             if ignored:
  1104                 if ignored == nf:
  1105                 if ignored == nf:
  1105                     ui.write(_("%s is ignored\n") % m.uipath(f))
  1106                     ui.write(_("%s is ignored\n") % uipathfn(f))
  1106                 else:
  1107                 else:
  1107                     ui.write(_("%s is ignored because of "
  1108                     ui.write(_("%s is ignored because of "
  1108                                "containing folder %s\n")
  1109                                "containing folder %s\n")
  1109                              % (m.uipath(f), ignored))
  1110                              % (uipathfn(f), ignored))
  1110                 ignorefile, lineno, line = ignoredata
  1111                 ignorefile, lineno, line = ignoredata
  1111                 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
  1112                 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
  1112                          % (ignorefile, lineno, line))
  1113                          % (ignorefile, lineno, line))
  1113             else:
  1114             else:
  1114                 ui.write(_("%s is not ignored\n") % m.uipath(f))
  1115                 ui.write(_("%s is not ignored\n") % uipathfn(f))
  1115 
  1116 
  1116 @command('debugindex', cmdutil.debugrevlogopts + cmdutil.formatteropts,
  1117 @command('debugindex', cmdutil.debugrevlogopts + cmdutil.formatteropts,
  1117          _('-c|-m|FILE'))
  1118          _('-c|-m|FILE'))
  1118 def debugindex(ui, repo, file_=None, **opts):
  1119 def debugindex(ui, repo, file_=None, **opts):
  1119     """dump index data for a storage primitive"""
  1120     """dump index data for a storage primitive"""