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
27745a19
Commit
27745a19
authored
Jul 31, 2013
by
Pawel Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svn,git: prevent error messages from being printed
parent
69b2e933
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
git.py
src/fetch/git.py
+8
-1
svn.py
src/fetch/svn.py
+9
-1
No files found.
src/fetch/git.py
View file @
27745a19
...
...
@@ -3,6 +3,7 @@
import
os
from
util
import
path
import
logging
from
tempfile
import
TemporaryFile
from
subprocess
import
Popen
,
PIPE
...
...
@@ -67,14 +68,20 @@ class Git(object):
def
check_commit_id
(
path
):
cur_dir
=
os
.
getcwd
()
commit
=
None
stderr
=
TemporaryFile
()
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
)
git_out
=
Popen
(
git_cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
stderr
,
close_fds
=
True
)
errmsg
=
stderr
.
readlines
()
if
errmsg
:
logging
.
debug
(
"git error message (in
%
s):
%
s"
%
(
path
,
'
\n
'
.
join
(
errmsg
)))
try
:
commit
=
git_out
.
stdout
.
readlines
()[
0
]
.
strip
()
except
IndexError
:
pass
finally
:
os
.
chdir
(
cur_dir
)
stderr
.
close
()
return
commit
src/fetch/svn.py
View file @
27745a19
...
...
@@ -2,6 +2,7 @@
import
os
import
logging
from
tempfile
import
TemporaryFile
from
util
import
path
from
subprocess
import
Popen
,
PIPE
...
...
@@ -42,14 +43,21 @@ class Svn(object):
def
check_revision_number
(
path
):
cur_dir
=
os
.
getcwd
()
revision
=
None
stderr
=
TemporaryFile
()
try
:
os
.
chdir
(
path
)
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
)
svn_out
=
Popen
(
svn_cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
stderr
,
close_fds
=
True
)
errmsg
=
stderr
.
readlines
()
if
errmsg
:
logging
.
debug
(
"svn error message (in
%
s):
%
s"
%
(
path
,
'
\n
'
.
join
(
errmsg
)))
try
:
revision
=
svn_out
.
stdout
.
readlines
()[
0
]
.
strip
()
except
IndexError
:
pass
finally
:
os
.
chdir
(
cur_dir
)
stderr
.
close
()
return
revision
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