Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
79073734
Commit
79073734
authored
14 years ago
by
Eric Davis
Browse files
Options
Downloads
Patches
Plain Diff
[
#221
Use git rev-parse to get the current sha for the version string
parent
56031032
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/chili_project/version.rb
+6
-18
6 additions, 18 deletions
lib/chili_project/version.rb
with
6 additions
and
18 deletions
lib/chili_project/version.rb
+
6
−
18
View file @
79073734
...
...
@@ -37,24 +37,12 @@ module ChiliProject
end
def
self
.
revision
revision
=
nil
entries_path
=
"
#{
RAILS_ROOT
}
/.svn/entries"
if
File
.
readable?
(
entries_path
)
begin
f
=
File
.
open
(
entries_path
,
'r'
)
entries
=
f
.
read
f
.
close
if
entries
.
match
(
%r{^
\d
+}
)
revision
=
$1
.
to_i
if
entries
.
match
(
%r{^
\d
+
\s
+dir
\s
+(
\d
+)
\s
}
)
else
xml
=
REXML
::
Document
.
new
(
entries
)
revision
=
xml
.
elements
[
'wc-entries'
].
elements
[
1
].
attributes
[
'revision'
].
to_i
end
rescue
# Could not find the current revision
end
end
revision
revision
=
`git rev-parse HEAD`
if
revision
.
present?
revision
.
strip
[
0
..
8
]
else
nil
end
end
REVISION
=
self
.
revision
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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