Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-pull-mirror-test2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
Testing Projects
hg-pull-mirror-test2
Commits
0e8d60d2
Commit
0e8d60d2
authored
19 years ago
by
jake
Browse files
Options
Downloads
Patches
Plain Diff
added annotate
fixed error page to get tmpl_dir
parent
c0faf508
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mercurial/hgweb.py
+40
-7
40 additions, 7 deletions
mercurial/hgweb.py
templates/annline.tmpl
+1
-0
1 addition, 0 deletions
templates/annline.tmpl
templates/htmlstart.tmpl
+5
-0
5 additions, 0 deletions
templates/htmlstart.tmpl
with
46 additions
and
7 deletions
mercurial/hgweb.py
+
40
−
7
View file @
0e8d60d2
...
...
@@ -82,8 +82,8 @@
print
'
</pre>
'
class
errpage
(
page
):
def
__init__
(
self
):
page
.
__init__
(
self
,
title
=
"
Mercurial Web Error Page
"
)
def
__init__
(
self
,
tmpl_dir
):
page
.
__init__
(
self
,
tmpl_dir
,
title
=
"
Mercurial Web Error Page
"
)
class
change_list
(
page
):
def
__init__
(
self
,
repo
,
tmpl_dir
,
reponame
,
numchanges
=
50
):
...
...
@@ -204,9 +204,11 @@
print
'
<div class=
"
filename
"
>%s (%s)</div>
'
%
\
(
cgi
.
escape
(
self
.
fn
),
self
.
nodestr
,
)
print
'
<a href=
"
?cmd=hist;fn=%s
"
>history</a><br />
'
%
self
.
fn
print
'
<a href=
"
?cmd=ann;fn=%s;nd=%s
"
>annotate</a><br />
'
%
\
(
self
.
fn
,
self
.
nodestr
)
def
content
(
self
):
print
'
<pre>
'
print
cgi
.
escape
(
self
.
repo
.
file
(
self
.
fn
).
read
(
self
.
node
))
print
'
</pre>
'
...
...
@@ -207,9 +209,27 @@
def
content
(
self
):
print
'
<pre>
'
print
cgi
.
escape
(
self
.
repo
.
file
(
self
.
fn
).
read
(
self
.
node
))
print
'
</pre>
'
class
annpage
(
page
):
def
__init__
(
self
,
repo
,
tmpl_dir
,
fn
,
node
):
page
.
__init__
(
self
,
tmpl_dir
)
self
.
repo
=
repo
self
.
fn
=
fn
self
.
nodestr
=
node
self
.
node
=
hg
.
bin
(
node
)
print
'
<div class=
"
annotation
"
>Annotated: %s (%s)</div>
'
%
\
(
cgi
.
escape
(
self
.
fn
),
self
.
nodestr
,
)
def
content
(
self
):
print
'
<pre>
'
for
n
,
l
in
self
.
repo
.
file
(
self
.
fn
).
annotate
(
self
.
node
):
cnode
=
self
.
repo
.
changelog
.
lookup
(
n
)
write
(
self
.
tmpl
.
do_page
(
'
annline.tmpl
'
,
cnode
=
hg
.
hex
(
cnode
),
cnum
=
'
% 6s
'
%
n
,
fn
=
self
.
fn
,
line
=
cgi
.
escape
(
l
[:
-
1
])))
print
'
</pre>
'
class
mfpage
(
page
):
def
__init__
(
self
,
repo
,
tmpl_dir
,
node
):
page
.
__init__
(
self
,
tmpl_dir
)
...
...
@@ -285,7 +305,7 @@
elif
args
[
'
cmd
'
][
0
]
==
'
chkin
'
:
if
not
args
.
has_key
(
'
nd
'
):
page
=
errpage
()
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>No Node!</div>
'
else
:
page
=
checkin
(
repo
,
self
.
tmpl_dir
,
args
[
'
nd
'
][
0
])
...
...
@@ -295,7 +315,7 @@
elif
args
[
'
cmd
'
][
0
]
==
'
file
'
:
if
not
(
args
.
has_key
(
'
nd
'
)
and
args
.
has_key
(
'
fn
'
))
and
\
not
(
args
.
has_key
(
'
cs
'
)
and
args
.
has_key
(
'
fn
'
)):
page
=
errpage
()
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>Invalid Args!</div>
'
else
:
if
args
.
has_key
(
'
nd
'
):
...
...
@@ -309,7 +329,7 @@
elif
args
[
'
cmd
'
][
0
]
==
'
mf
'
:
if
not
args
.
has_key
(
'
nd
'
):
page
=
errpage
()
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>No Node!</div>
'
else
:
page
=
mfpage
(
repo
,
self
.
tmpl_dir
,
args
[
'
nd
'
][
0
])
...
...
@@ -318,10 +338,10 @@
elif
args
[
'
cmd
'
][
0
]
==
'
hist
'
:
if
not
args
.
has_key
(
'
fn
'
):
page
=
errpage
()
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>No Filename!</div>
'
else
:
page
=
histpage
(
repo
,
self
.
tmpl_dir
,
args
[
'
fn
'
][
0
])
page
.
content
()
page
.
endpage
()
...
...
@@ -322,9 +342,22 @@
print
'
<div class=
"
errmsg
"
>No Filename!</div>
'
else
:
page
=
histpage
(
repo
,
self
.
tmpl_dir
,
args
[
'
fn
'
][
0
])
page
.
content
()
page
.
endpage
()
elif
args
[
'
cmd
'
][
0
]
==
'
ann
'
:
if
not
args
.
has_key
(
'
fn
'
):
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>No Filename!</div>
'
elif
not
args
.
has_key
(
'
nd
'
):
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>No Node!</div>
'
else
:
page
=
annpage
(
repo
,
self
.
tmpl_dir
,
args
[
'
fn
'
][
0
],
args
[
'
nd
'
][
0
])
page
.
content
()
page
.
endpage
()
elif
args
[
'
cmd
'
][
0
]
==
'
branches
'
:
httphdr
(
"
text/plain
"
)
nodes
=
[]
...
...
@@ -355,7 +388,7 @@
sys
.
stdout
.
write
(
z
.
flush
())
else
:
page
=
errpage
()
page
=
errpage
(
self
.
tmpl_dir
)
print
'
<div class=
"
errmsg
"
>unknown command: %s</div>
'
%
\
cgi
.
escape
(
args
[
'
cmd
'
][
0
])
page
.
endpage
()
...
...
This diff is collapsed.
Click to expand it.
templates/annline.tmpl
0 → 100644
+
1
−
0
View file @
0e8d60d2
<a class="revnumlink" href="?cmd=chkin;nd=#cnode#">#cnum#</a>:<a class="annlinelink" href="?cmd=file;fn=#fn#;cs=#cnode#">#line#</a>
This diff is collapsed.
Click to expand it.
templates/htmlstart.tmpl
+
5
−
0
View file @
0e8d60d2
...
...
@@ -9,6 +9,7 @@
.filename
{
font-size
:
150%
;
color
:
purple
;
}
.manifest
{
font-size
:
150%
;
color
:
purple
;
}
.filehist
{
font-size
:
150%
;
color
:
purple
;
}
.annotation
{
font-size
:
150%
;
color
:
purple
;
}
.plusline
{
color
:
green
;
}
.minusline
{
color
:
red
;
}
.atline
{
color
:
purple
;
}
...
...
@@ -12,6 +13,10 @@
.plusline
{
color
:
green
;
}
.minusline
{
color
:
red
;
}
.atline
{
color
:
purple
;
}
a
.annlinelink
{
text-decoration
:
none
;
color
:
black
;
}
a
.revnumlink
{
text-decoration
:
none
;
color
:
black
;
}
a
.annlinelink
:hover
{
text-decoration
:
none
;
color
:
blue
;
}
a
.revnumlink
:hover
{
text-decoration
:
none
;
color
:
blue
;
}
</style>
</HEAD>
<BODY>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment