--- a/hgext/bugzilla.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/bugzilla.py Fri Nov 14 13:59:25 2008 +0100
@@ -291,7 +291,7 @@
tmpl = templater.parsestring(tmpl, quoted=False)
t.use_template(tmpl)
self.ui.pushbuffer()
- t.show(changenode=ctx.node(), changes=ctx.changeset(),
+ t.show(ctx, changes=ctx.changeset(),
bug=str(bugid),
hgweb=self.ui.config('web', 'baseurl'),
root=self.repo.root,
--- a/hgext/children.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/children.py Fri Nov 14 13:59:25 2008 +0100
@@ -28,8 +28,8 @@
ctx = repo[rev]
displayer = cmdutil.show_changeset(ui, repo, opts)
- for node in [cp.node() for cp in ctx.children()]:
- displayer.show(changenode=node)
+ for cctx in ctx.children():
+ displayer.show(cctx)
cmdtable = {
--- a/hgext/churn.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/churn.py Fri Nov 14 13:59:25 2008 +0100
@@ -63,7 +63,7 @@
tmpl = maketemplater(ui, repo, tmpl)
def getkey(ctx):
ui.pushbuffer()
- tmpl.show(changenode=ctx.node())
+ tmpl.show(ctx)
return ui.popbuffer()
count = pct = 0
--- a/hgext/graphlog.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/graphlog.py Fri Nov 14 13:59:25 2008 +0100
@@ -325,7 +325,7 @@
# log_strings is the list of all log strings to draw alongside
# the graph.
ui.pushbuffer()
- cs_printer.show(rev, node)
+ cs_printer.show(repo[rev])
log_strings = ui.popbuffer().split("\n")[:-1]
if node in repo_parents:
node_ch = "@"
--- a/hgext/keyword.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/keyword.py Fri Nov 14 13:59:25 2008 +0100
@@ -151,7 +151,7 @@
kw = mobj.group(1)
self.ct.use_template(self.templates[kw])
self.ui.pushbuffer()
- self.ct.show(changenode=node, root=self.repo.root, file=path)
+ self.ct.show(self.repo[node], root=self.repo.root, file=path)
ekw = templatefilters.firstline(self.ui.popbuffer())
return '$%s: %s $' % (kw, ekw)
return subfunc(kwsub, data)
--- a/hgext/notify.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/notify.py Fri Nov 14 13:59:25 2008 +0100
@@ -165,7 +165,7 @@
def node(self, node):
'''format one changeset.'''
- self.t.show(changenode=node, changes=self.repo.changelog.read(node),
+ self.t.show(self.repo[node], changes=self.repo.changelog.read(node),
baseurl=self.ui.config('web', 'baseurl'),
root=self.repo.root,
webroot=self.root)
--- a/hgext/transplant.py Fri Nov 14 12:44:26 2008 +0100
+++ b/hgext/transplant.py Fri Nov 14 13:59:25 2008 +0100
@@ -398,7 +398,7 @@
transplants = []
merges = []
for node in nodes:
- displayer.show(changenode=node)
+ displayer.show(repo[node])
action = None
while not action:
action = ui.prompt(_('apply changeset? [ynmpcq?]:'))
--- a/mercurial/cmdutil.py Fri Nov 14 12:44:26 2008 +0100
+++ b/mercurial/cmdutil.py Fri Nov 14 13:59:25 2008 +0100
@@ -596,26 +596,24 @@
return 1
return 0
- def show(self, rev=0, changenode=None, copies=(), **props):
+ def show(self, ctx, copies=(), **props):
if self.buffered:
self.ui.pushbuffer()
- self._show(rev, changenode, copies, props)
- self.hunk[rev] = self.ui.popbuffer()
+ self._show(ctx, copies, props)
+ self.hunk[ctx.rev()] = self.ui.popbuffer()
else:
- self._show(rev, changenode, copies, props)
+ self._show(ctx, copies, props)
- def _show(self, rev, changenode, copies, props):
+ def _show(self, ctx, copies, props):
'''show a single changeset or file revision'''
- log = self.repo.changelog
- if changenode is None:
- changenode = log.node(rev)
- elif not rev:
- rev = log.rev(changenode)
+ changenode = ctx.node()
+ rev = ctx.rev()
if self.ui.quiet:
self.ui.write("%d:%s\n" % (rev, short(changenode)))
return
+ log = self.repo.changelog
changes = log.read(changenode)
date = util.datestr(changes[2])
extra = changes[5]
@@ -716,14 +714,12 @@
'''set template string to use'''
self.t.cache['changeset'] = t
- def _show(self, rev, changenode, copies, props):
+ def _show(self, ctx, copies, props):
'''show a single changeset or file revision'''
+ changenode = ctx.node()
+ rev = ctx.rev()
+
log = self.repo.changelog
- if changenode is None:
- changenode = log.node(rev)
- elif not rev:
- rev = log.rev(changenode)
-
changes = log.read(changenode)
def showlist(name, values, plural=None, **args):
--- a/mercurial/commands.py Fri Nov 14 12:44:26 2008 +0100
+++ b/mercurial/commands.py Fri Nov 14 13:59:25 2008 +0100
@@ -9,7 +9,7 @@
from repo import RepoError, NoCapability
from i18n import _, gettext
import os, re, sys
-import hg, util, revlog, bundlerepo, extensions, copies
+import hg, util, revlog, bundlerepo, extensions, copies, context
import difflib, patch, time, help, mdiff, tempfile, url
import version
import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
@@ -288,13 +288,13 @@
if len(nodes) == 1:
# narrowed it down to a single revision
ui.write(_("The first %s revision is:\n") % transition)
- displayer.show(changenode=nodes[0])
+ displayer.show(repo[nodes[0]])
else:
# multiple possible revisions
ui.write(_("Due to skipped revisions, the first "
"%s revision could be any of:\n") % transition)
for n in nodes:
- displayer.show(changenode=n)
+ displayer.show(repo[n])
def check_state(state, interactive=True):
if not state['good'] or not state['bad']:
@@ -1270,7 +1270,7 @@
return 1
displayer = cmdutil.show_changeset(ui, repo, opts)
for n in heads:
- displayer.show(changenode=n)
+ displayer.show(repo[n])
def help_(ui, name=None, with_version=False):
"""show help for a given topic or a help overview
@@ -1729,7 +1729,7 @@
if opts.get('no_merges') and len(parents) == 2:
continue
count += 1
- displayer.show(changenode=n)
+ displayer.show(other[n])
finally:
if hasattr(other, 'close'):
other.close()
@@ -1867,7 +1867,6 @@
displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
for st, rev, fns in changeiter:
if st == 'add':
- changenode = repo.changelog.node(rev)
parents = [p for p in repo.changelog.parentrevs(rev)
if p != nullrev]
if opts.get('no_merges') and len(parents) == 2:
@@ -1913,7 +1912,7 @@
rename = getrenamed(fn, rev)
if rename:
copies.append((fn, rename[0]))
- displayer.show(rev, changenode, copies=copies)
+ displayer.show(context.changectx(repo, rev), copies=copies)
elif st == 'iter':
if count == limit: break
if displayer.flush(rev):
@@ -2026,7 +2025,7 @@
if opts.get('no_merges') and len(parents) == 2:
continue
count += 1
- displayer.show(changenode=n)
+ displayer.show(repo[n])
def parents(ui, repo, file_=None, **opts):
"""show the parents of the working dir or revision
@@ -2066,7 +2065,7 @@
displayer = cmdutil.show_changeset(ui, repo, opts)
for n in p:
if n != nullid:
- displayer.show(changenode=n)
+ displayer.show(repo[n])
def paths(ui, repo, search=None):
"""show definition of symbolic path names
@@ -2842,7 +2841,7 @@
that repository becomes the current tip. The "tip" tag is special
and cannot be renamed or assigned to a different changeset.
"""
- cmdutil.show_changeset(ui, repo, opts).show(len(repo) - 1)
+ cmdutil.show_changeset(ui, repo, opts).show(repo[len(repo) - 1])
def unbundle(ui, repo, fname1, *fnames, **opts):
"""apply one or more changegroup files