mercurial/commands.py
changeset 27671 067d87feeb11
parent 27669 b1824a1725ed
child 27672 f2da9bb87ae0
equal deleted inserted replaced
27670:4374f039d269 27671:067d87feeb11
  2433     bundletype = btypes.get(bundletype)
  2433     bundletype = btypes.get(bundletype)
  2434     if bundletype not in changegroup.bundletypes:
  2434     if bundletype not in changegroup.bundletypes:
  2435         raise error.Abort(_('unknown bundle type specified with --type'))
  2435         raise error.Abort(_('unknown bundle type specified with --type'))
  2436     changegroup.writebundle(ui, bundle, bundlepath, bundletype)
  2436     changegroup.writebundle(ui, bundle, bundlepath, bundletype)
  2437 
  2437 
  2438 @command('debugignore', [], '')
  2438 @command('debugignore', [], '[FILE]')
  2439 def debugignore(ui, repo, *values, **opts):
  2439 def debugignore(ui, repo, *files, **opts):
  2440     """display the combined ignore pattern"""
  2440     """display the combined ignore pattern and information about ignored files
       
  2441 
       
  2442     With no argument display the combined ignore pattern.
       
  2443 
       
  2444     Given space separated file names, shows if the given file is ignored.
       
  2445     """
  2441     ignore = repo.dirstate._ignore
  2446     ignore = repo.dirstate._ignore
  2442     includepat = getattr(ignore, 'includepat', None)
  2447     if not files:
  2443     if includepat is not None:
  2448         # Show all the patterns
  2444         ui.write("%s\n" % includepat)
  2449         includepat = getattr(ignore, 'includepat', None)
       
  2450         if includepat is not None:
       
  2451             ui.write("%s\n" % includepat)
       
  2452         else:
       
  2453             raise error.Abort(_("no ignore patterns found"))
  2445     else:
  2454     else:
  2446         raise error.Abort(_("no ignore patterns found"))
  2455         for f in files:
       
  2456             ignored = None
       
  2457             if f != '.':
       
  2458                 if ignore(f):
       
  2459                     ignored = f
       
  2460                 else:
       
  2461                     for p in util.finddirs(f):
       
  2462                         if ignore(p):
       
  2463                             ignored = p
       
  2464                             break
       
  2465             if ignored:
       
  2466                 if ignored == f:
       
  2467                     ui.write("%s is ignored\n" % f)
       
  2468                 else:
       
  2469                     ui.write("%s is ignored because of containing folder %s\n"
       
  2470                              % (f, ignored))
       
  2471             else:
       
  2472                 ui.write("%s is not ignored\n" % f)
  2447 
  2473 
  2448 @command('debugindex', debugrevlogopts +
  2474 @command('debugindex', debugrevlogopts +
  2449     [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
  2475     [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
  2450     _('[-f FORMAT] -c|-m|FILE'),
  2476     _('[-f FORMAT] -c|-m|FILE'),
  2451     optionalrepo=True)
  2477     optionalrepo=True)