mercurial/commands.py
changeset 20136 1df77035c814
parent 20108 af12f58e2aa0
child 20156 28fe5abc906f
equal deleted inserted replaced
20135:e39bd4b7be78 20136:1df77035c814
  2243                 if fullpaths:
  2243                 if fullpaths:
  2244                     addfile(f)
  2244                     addfile(f)
  2245                     continue
  2245                     continue
  2246                 s = f.find(os.sep, speclen)
  2246                 s = f.find(os.sep, speclen)
  2247                 if s >= 0:
  2247                 if s >= 0:
  2248                     adddir(f[:s + 1])
  2248                     adddir(f[:s])
  2249                 else:
  2249                 else:
  2250                     addfile(f)
  2250                     addfile(f)
  2251         return files, dirs
  2251         return files, dirs
  2252 
  2252 
  2253     acceptable = ''
  2253     acceptable = ''
  2264     files, dirs = set(), set()
  2264     files, dirs = set(), set()
  2265     for spec in specs:
  2265     for spec in specs:
  2266         f, d = complete(spec, acceptable or 'nmar')
  2266         f, d = complete(spec, acceptable or 'nmar')
  2267         files.update(f)
  2267         files.update(f)
  2268         dirs.update(d)
  2268         dirs.update(d)
  2269     if not files and len(dirs) == 1:
       
  2270         # force the shell to consider a completion that matches one
       
  2271         # directory and zero files to be ambiguous
       
  2272         dirs.add(iter(dirs).next() + '.')
       
  2273     files.update(dirs)
  2269     files.update(dirs)
  2274     ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
  2270     ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
  2275     ui.write('\n')
  2271     ui.write('\n')
  2276 
  2272 
  2277 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'))
  2273 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'))