Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irker
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
37907644
Commit
37907644
authored
12 years ago
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
nenolod's patch fixing URL generation.
parent
ef1d7d31
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
irkbot.py
+10
-5
10 additions, 5 deletions
irkbot.py
with
10 additions
and
5 deletions
irkbot.py
+
10
−
5
View file @
37907644
...
...
@@ -72,6 +72,15 @@ version = "1.0"
def
do
(
command
):
return
commands
.
getstatusoutput
(
command
)[
1
]
def
urlify
(
extractor
,
commit
):
prefix
=
urlprefix
%
extractor
.
__dict__
# Try to tinyfy a reference to a web view for this commit.
try
:
url
=
open
(
urllib
.
urlretrieve
(
tinyifier
+
prefix
+
commit
)[
0
]).
read
()
except
:
url
=
prefix
+
commit
return
url
class
GitExtractor
:
"
Metadata extraction for the git version control system.
"
def
__init__
(
self
,
project
=
None
):
...
...
@@ -99,11 +108,7 @@ class GitExtractor:
# Revision level
self
.
refname
=
do
(
"
git symbolic-ref HEAD 2>/dev/null
"
)
self
.
commit
=
do
(
"
git rev-parse HEAD
"
)
# Try to tinyfy a reference to a web view for this commit.
try
:
self
.
url
=
open
(
urllib
.
urlretrieve
(
tinyifier
+
urlprefix
+
self
.
commit
)[
0
]).
read
()
except
:
self
.
url
=
urlprefix
+
self
.
commit
self
.
url
=
urlify
(
self
,
self
.
commit
)
self
.
branch
=
os
.
path
.
basename
(
self
.
refname
)
...
...
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