comparison mercurial/cmdutil.py @ 37270:6ff8bd691fb8

narrow: add trailing slash to dir earlier for debug{revlog,index,data} The treemanifest code internally uses trailing slashes on directories (except for the root directory, which is an empty string). We should make sure we pass in directories with trailing slashes when we work with the treemanifest code. For some reason, I seem to have decided to be nice to the callers instead in 49c583ca48c4 (treemanifest: add --dir option to debug{revlog,data,index}, 2015-04-12). Let's fix that and pay the cost of fixing up the directory name close close to where we get it from the user. Differential Revision: https://phab.mercurial-scm.org/D3032
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 02 Apr 2018 23:52:43 -0700
parents 335e19c6b7fa
children 8823615f68a5
comparison
equal deleted inserted replaced
37269:14cd5290c4e6 37270:6ff8bd691fb8
1056 r = repo.unfiltered().changelog 1056 r = repo.unfiltered().changelog
1057 elif dir: 1057 elif dir:
1058 if 'treemanifest' not in repo.requirements: 1058 if 'treemanifest' not in repo.requirements:
1059 raise error.Abort(_("--dir can only be used on repos with " 1059 raise error.Abort(_("--dir can only be used on repos with "
1060 "treemanifest enabled")) 1060 "treemanifest enabled"))
1061 if not dir.endswith('/'):
1062 dir = dir + '/'
1061 dirlog = repo.manifestlog._revlog.dirlog(dir) 1063 dirlog = repo.manifestlog._revlog.dirlog(dir)
1062 if len(dirlog): 1064 if len(dirlog):
1063 r = dirlog 1065 r = dirlog
1064 elif mf: 1066 elif mf:
1065 r = repo.manifestlog._revlog 1067 r = repo.manifestlog._revlog