diff --git a/contrib/synthrepo.py b/contrib/synthrepo.py --- a/contrib/synthrepo.py +++ b/contrib/synthrepo.py @@ -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 --git a/hgext/fastannotate/formatter.py b/hgext/fastannotate/formatter.py --- a/hgext/fastannotate/formatter.py +++ b/hgext/fastannotate/formatter.py @@ -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 --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -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'):