Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
d53a573d
Commit
d53a573d
authored
Jan 15, 2020
by
Lorenz Hüdepohl
Browse files
Avoid error output from git update check
parent
d56ab3f8
Pipeline
#67095
passed with stage
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
d53a573d
...
...
@@ -52,7 +52,7 @@ def check_for_update():
import
os
import
sys
import
time
from
subprocess
import
check_output
,
call
from
subprocess
import
check_output
,
call
,
DEVNULL
if
hasattr
(
sys
.
modules
[
"mpcdf_common"
],
"checked_for_updates"
):
return
...
...
@@ -88,7 +88,7 @@ def check_for_update():
with
open
(
rev_file
,
"r"
)
as
fd
:
server_rev
=
fd
.
read
().
strip
()
if
call
([
"git"
,
"--git-dir"
,
git_dir
,
"merge-base"
,
"--is-ancestor"
,
server_rev
,
"HEAD"
])
==
0
:
if
call
([
"git"
,
"--git-dir"
,
git_dir
,
"merge-base"
,
"--is-ancestor"
,
server_rev
,
"HEAD"
]
,
stderr
=
DEVNULL
)
==
0
:
# Server rev is older than ours. Check again
update_server_rev
()
...
...
@@ -97,7 +97,7 @@ def check_for_update():
if
server_rev
!=
local_rev
:
print
(
"Note from MPCDF osc plugins:"
,
file
=
sys
.
stderr
)
if
call
([
"git"
,
"--git-dir"
,
git_dir
,
"merge-base"
,
"--is-ancestor"
,
server_rev
,
"HEAD"
])
==
0
:
if
call
([
"git"
,
"--git-dir"
,
git_dir
,
"merge-base"
,
"--is-ancestor"
,
server_rev
,
"HEAD"
]
,
stderr
=
DEVNULL
)
==
0
:
print
(
" You have unpushed commits in"
,
plugin_dir
,
"- consider pushing them"
,
file
=
sys
.
stderr
)
print
(
file
=
sys
.
stderr
)
else
:
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment