Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
71f3c0bd
Commit
71f3c0bd
authored
Jun 03, 2015
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed git hash number extraction
parent
aae99306
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
scripts/query_version_info.py
scripts/query_version_info.py
+12
-3
No files found.
scripts/query_version_info.py
View file @
71f3c0bd
...
...
@@ -9,11 +9,16 @@ if 3 == sys.version_info.major:
from
urllib.parse
import
unquote
def
to_str
(
x
):
assert
isinstance
(
x
,
str
)
or
isinstance
(
x
,
bytes
)
if
isinstance
(
x
,
str
):
return
x
else
:
return
x
.
decode
(
"utf-8"
)
else
:
from
urllib
import
unquote
def
to_str
(
x
):
assert
isinstance
(
x
,
str
)
or
isinstance
(
x
,
unicode
)
return
unicode
(
x
)
OUT_FILE
=
sys
.
stdout
...
...
@@ -29,10 +34,14 @@ def get_version_information(top_level_dir):
stderr
=
subprocess
.
PIPE
).
strip
()
except
subprocess
.
CalledProcessError
:
version_info
=
subprocess
.
check_output
(
version_info
=
to_str
(
subprocess
.
check_output
(
"git rev-parse --abbrev-ref HEAD"
,
shell
=
True
).
strip
()
).
strip
())
version_info
+=
"-"
+
to_str
(
subprocess
.
check_output
(
"git --no-pager log -1 --pretty=format:%H"
,
shell
=
True
).
strip
())
else
:
dir_name
=
os
.
path
.
basename
(
top_level_dir
)
match
=
re
.
match
(
r
"kumir2-(.+)"
,
dir_name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment