# HG changeset patch # User Martin von Zweigbergk # Date 1548488591 28800 # Node ID 2ff8994ac71dccd4e42817b7d29aa529a5d368ce # Parent 0bd56c2913591faf879b0a99ba918643b47bacb0 cleanup: use repo['.'] instead of repo[None].p1() Differential Revision: https://phab.mercurial-scm.org/D5707 diff -r 0bd56c291359 -r 2ff8994ac71d contrib/synthrepo.py --- a/contrib/synthrepo.py Fri Jan 25 23:36:23 2019 -0800 +++ b/contrib/synthrepo.py Fri Jan 25 23:43:11 2019 -0800 @@ -349,7 +349,7 @@ # to the modeled directory structure. initcount = int(opts['initfiles']) if initcount and initdirs: - pctx = repo[None].p1() + pctx = repo['.'] dirs = set(pctx.dirs()) files = {} diff -r 0bd56c291359 -r 2ff8994ac71d hgext/fastannotate/formatter.py --- a/hgext/fastannotate/formatter.py Fri Jan 25 23:36:23 2019 -0800 +++ b/hgext/fastannotate/formatter.py Fri Jan 25 23:43:11 2019 -0800 @@ -38,8 +38,8 @@ if self.opts.get('rev') == 'wdir()': orig = hexfunc hexfunc = lambda x: None if x is None else orig(x) - wnode = hexfunc(repo[None].p1().node()) + '+' - wrev = '%d' % repo[None].p1().rev() + wnode = hexfunc(repo['.'].node()) + '+' + wrev = '%d' % repo['.'].rev() wrevpad = '' if not opts.get('changeset'): # only show + if changeset is hidden wrev += '+' diff -r 0bd56c291359 -r 2ff8994ac71d mercurial/commands.py --- a/mercurial/commands.py Fri Jan 25 23:36:23 2019 -0800 +++ b/mercurial/commands.py Fri Jan 25 23:43:11 2019 -0800 @@ -1102,7 +1102,7 @@ with repo.wlock(): if opts.get('clean'): - label = repo[None].p1().branch() + label = repo['.'].branch() repo.dirstate.setbranch(label) ui.status(_('reset working directory to branch %s\n') % label) elif label: @@ -1672,8 +1672,8 @@ if not bheads: raise error.Abort(_('can only close branch heads')) elif opts.get('amend'): - if repo[None].p1().p1().branch() != branch and \ - repo[None].p1().p2().branch() != branch: + if repo['.'].p1().branch() != branch and \ + repo['.'].p2().branch() != branch: raise error.Abort(_('can only close branch heads')) if opts.get('amend'):