# HG changeset patch # User Adrian Buehlmann # Date 1256403700 -7200 # Node ID 64425c5a92572a4f55af4d540a502e876b472755 # Parent 926eba48eac97a91a6ef33653da190ae7c9b039b cmdutil: minor refactoring of changeset_printer._show - use ctx.branch() instead of directly accessing the extra field "branch" - move definitions of locals ('extra' and 'branch') down to where they are used diff -r 926eba48eac9 -r 64425c5a9257 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Oct 24 00:29:25 2009 +0200 +++ b/mercurial/cmdutil.py Sat Oct 24 19:01:40 2009 +0200 @@ -653,8 +653,6 @@ log = self.repo.changelog date = util.datestr(ctx.date()) - extra = ctx.extra() - branch = extra.get("branch") hexfunc = self.ui.debugflag and hex or short @@ -663,6 +661,7 @@ self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) + branch = ctx.branch() # don't show the default branch name if branch != 'default': branch = encoding.tolocal(branch) @@ -691,6 +690,7 @@ copies = ['%s (%s)' % c for c in copies] self.ui.write(_("copies: %s\n") % ' '.join(copies)) + extra = ctx.extra() if extra and self.ui.debugflag: for key, value in sorted(extra.items()): self.ui.write(_("extra: %s=%s\n")