Mercurial > public > mercurial-scm > hg-stable
comparison contrib/synthrepo.py @ 41420:2ff8994ac71d
cleanup: use repo['.'] instead of repo[None].p1()
Differential Revision: https://phab.mercurial-scm.org/D5707
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 25 Jan 2019 23:43:11 -0800 |
parents | 0bd56c291359 |
children | c07812bdd568 |
comparison
equal
deleted
inserted
replaced
41419:0bd56c291359 | 41420:2ff8994ac71d |
---|---|
347 | 347 |
348 # Synthesize a single initial revision adding files to the repo according | 348 # Synthesize a single initial revision adding files to the repo according |
349 # to the modeled directory structure. | 349 # to the modeled directory structure. |
350 initcount = int(opts['initfiles']) | 350 initcount = int(opts['initfiles']) |
351 if initcount and initdirs: | 351 if initcount and initdirs: |
352 pctx = repo[None].p1() | 352 pctx = repo['.'] |
353 dirs = set(pctx.dirs()) | 353 dirs = set(pctx.dirs()) |
354 files = {} | 354 files = {} |
355 | 355 |
356 def validpath(path): | 356 def validpath(path): |
357 # Don't pick filenames which are already directory names. | 357 # Don't pick filenames which are already directory names. |