Patch: make "hg serve" show file diff links in changeset view
Peter Arrenbrecht
peter.arrenbrecht at gmail.com
Sat Oct 27 14:51:45 CDT 2007
On 10/16/07, Peter Arrenbrecht <peter.arrenbrecht at gmail.com> wrote:
> In "hg serve"'s output for a changeset, you first get a list of
> changed files, then the diff. But clicking a file shows the file, not
> the diff. And the list does not tell me whether the files where
> additions, removals, or changes. Something like diffstat would be
> welcome here. And an additional link on the files that takes you to
> the file's diff.
>
> What do you people think? Any objections to my attempting this?
>
> -peo
Is this acceptable?
-peo
# HG changeset patch
# User peter.arrenbrecht at gmail.com
# Date 1193513858 -7200
# Node ID fa476b910b3b96380b1906fa4817c4dc6fe8e64c
# Parent 5d8f5ad45c1260c7ec2e4ea77d8a877cd7a1db14
Use file diff links in the changeset view instead of file view links,
like in the changelog view. From a file diff, you can easily reach the
file view, but not vice versa.
diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -320,7 +320,7 @@ class hgweb(object):
files = []
parity = paritygen(self.stripecount)
for f in ctx.files():
- files.append(self.t("filenodelink",
+ files.append(self.t("filedifflink",
node=hex(n), file=f,
parity=parity.next()))
More information about the Mercurial
mailing list