Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
b495025d
Commit
b495025d
authored
Jul 31, 2013
by
Pawel Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix revision checking
parent
9df5893e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
9 deletions
+29
-9
__init__.py
src/fetch/__init__.py
+2
-0
git.py
src/fetch/git.py
+5
-1
svn.py
src/fetch/svn.py
+7
-3
module.py
src/module.py
+14
-4
module_pool.py
src/module_pool.py
+1
-1
No files found.
src/fetch/__init__.py
View file @
b495025d
#!/usr/bin/env python
from
backend_factory
import
BackendFactory
from
svn
import
Svn
from
git
import
Git
src/fetch/git.py
View file @
b495025d
...
...
@@ -66,11 +66,15 @@ class Git(object):
@
staticmethod
def
check_commit_id
(
path
):
cur_dir
=
os
.
getcwd
()
commit
=
None
try
:
os
.
chdir
(
path
)
git_cmd
=
'git log -1 --format="
%
H" | cut -c1-32'
git_out
=
Popen
(
git_cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
PIPE
,
close_fds
=
True
)
commit
=
git_out
.
stdout
.
readlines
()[
0
]
.
strip
()
try
:
commit
=
git_out
.
stdout
.
readlines
()[
0
]
.
strip
()
except
IndexError
:
pass
finally
:
os
.
chdir
(
cur_dir
)
return
commit
src/fetch/svn.py
View file @
b495025d
...
...
@@ -41,11 +41,15 @@ class Svn(object):
@
staticmethod
def
check_revision_number
(
path
):
cur_dir
=
os
.
getcwd
()
revision
=
None
try
:
os
.
chdir
(
path
)
svn_cmd
=
"svn info | awk '{if(NR == 5) {print $2}}'"
svn_out
=
Popen
(
svn_cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
PIPE
,
close_fds
=
True
)
revision
=
svn_out
.
stdout
.
readlines
()[
0
]
.
strip
()
svn_cmd
=
"svn info 2>/dev/null | awk '{if(NR == 5) {print $2}}'"
svn_out
=
Popen
(
svn_cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
None
,
close_fds
=
True
)
try
:
revision
=
svn_out
.
stdout
.
readlines
()[
0
]
.
strip
()
except
IndexError
:
pass
finally
:
os
.
chdir
(
cur_dir
)
return
revision
src/module.py
View file @
b495025d
...
...
@@ -172,10 +172,7 @@ class Module(object):
self
.
manifest
=
self
.
__search_for_manifest
()
if
self
.
path
is
None
:
raise
RuntimeError
()
if
self
.
source
==
"svn"
:
self
.
revision
=
fetch
.
svn
.
check_revision_number
(
self
.
path
)
elif
self
.
source
==
"git"
:
self
.
revision
=
fetch
.
git
.
check_commit_id
(
self
.
path
)
manifest_parser
=
ManifestParser
()
# For non-top modules
...
...
@@ -352,6 +349,19 @@ class Module(object):
m
.
parse_manifest
()
m
.
process_manifest
()
if
self
==
global_mod
.
top_module
:
revision
=
fetch
.
Svn
.
check_revision_number
(
self
.
path
)
if
revision
is
None
:
commit
=
fetch
.
Git
.
check_commit_id
(
self
.
path
)
self
.
revision
=
commit
else
:
self
.
revision
=
revision
else
:
if
self
.
source
==
"svn"
:
self
.
revision
=
fetch
.
Svn
.
check_revision_number
(
self
.
path
)
elif
self
.
source
==
"git"
:
self
.
revision
=
fetch
.
Git
.
check_commit_id
(
self
.
path
)
def
_make_list_of_paths
(
self
,
list_of_paths
):
paths
=
[]
logging
.
debug
(
str
(
list_of_paths
))
...
...
src/module_pool.py
View file @
b495025d
...
...
@@ -27,6 +27,7 @@ import global_mod
import
dep_solver
from
srcfile
import
SourceFileSet
from
fetch
import
BackendFactory
import
fetch
class
ModulePool
(
list
):
...
...
@@ -126,7 +127,6 @@ class ModulePool(list):
logging
.
debug
(
"NOT appended to fetch queue: "
+
str
(
mod
.
url
))
def
build_global_file_list
(
self
):
from
srcfile
import
SourceFileSet
ret
=
SourceFileSet
()
for
module
in
self
:
ret
.
add
(
module
.
files
)
...
...
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