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
Tobias Hunger
qt-creator
Commits
59592c82
Commit
59592c82
authored
Jun 15, 2010
by
Friedemann Kleint
Browse files
VCS: Do not force LANG=C on all commands.
Introduce extra flag. Task-number: QTCREATORBUG-1623
parent
ff7c543a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/git/gitclient.cpp
View file @
59592c82
...
...
@@ -1085,7 +1085,7 @@ QProcessEnvironment GitClient::processEnvironment() const
if
(
m_settings
.
adoptPath
)
environment
.
insert
(
QLatin1String
(
"PATH"
),
m_settings
.
path
);
// Set up SSH and C locale (required by git using perl).
VCSBase
::
VCSBasePlugin
::
setProcessEnvironment
(
&
environment
);
VCSBase
::
VCSBasePlugin
::
setProcessEnvironment
(
&
environment
,
false
);
return
environment
;
}
...
...
src/plugins/vcsbase/checkoutjobs.cpp
View file @
59592c82
...
...
@@ -72,7 +72,7 @@ ProcessCheckoutJobPrivate::ProcessCheckoutJobPrivate(const QString &b,
{
if
(
!
workingDirectory
.
isEmpty
())
process
->
setWorkingDirectory
(
workingDirectory
);
VCSBasePlugin
::
setProcessEnvironment
(
&
processEnv
);
VCSBasePlugin
::
setProcessEnvironment
(
&
processEnv
,
false
);
process
->
setProcessEnvironment
(
processEnv
);
}
...
...
src/plugins/vcsbase/vcsbaseplugin.cpp
View file @
59592c82
...
...
@@ -686,9 +686,10 @@ bool VCSBasePlugin::isSshPromptConfigured()
return
!
sshPrompt
().
isEmpty
();
}
void
VCSBasePlugin
::
setProcessEnvironment
(
QProcessEnvironment
*
e
)
void
VCSBasePlugin
::
setProcessEnvironment
(
QProcessEnvironment
*
e
,
bool
forceCLocale
)
{
e
->
insert
(
QLatin1String
(
"LANG"
),
QString
(
QLatin1Char
(
'C'
)));
if
(
forceCLocale
)
e
->
insert
(
QLatin1String
(
"LANG"
),
QString
(
QLatin1Char
(
'C'
)));
const
QString
sshPromptBinary
=
sshPrompt
();
if
(
!
sshPromptBinary
.
isEmpty
())
e
->
insert
(
QLatin1String
(
"SSH_ASKPASS"
),
sshPromptBinary
);
...
...
@@ -738,6 +739,8 @@ Utils::SynchronousProcessResponse
nsp
<<
"ssh ("
<<
sshPromptConfigured
<<
')'
;
if
(
flags
&
SuppressCommandLogging
)
nsp
<<
"suppress_log"
;
if
(
flags
&
ForceCLocale
)
nsp
<<
"c_locale"
;
if
(
outputCodec
)
nsp
<<
" Codec: "
<<
outputCodec
->
name
();
}
...
...
@@ -747,7 +750,7 @@ Utils::SynchronousProcessResponse
if
(
!
workingDir
.
isEmpty
())
process
.
setWorkingDirectory
(
workingDir
);
VCSBase
::
VCSBasePlugin
::
setProcessEnvironment
(
&
env
);
VCSBase
::
VCSBasePlugin
::
setProcessEnvironment
(
&
env
,
(
flags
&
ForceCLocale
)
);
process
.
setProcessEnvironment
(
env
);
process
.
setTimeout
(
timeOutMS
);
if
(
outputCodec
)
...
...
src/plugins/vcsbase/vcsbaseplugin.h
View file @
59592c82
...
...
@@ -176,10 +176,10 @@ public:
static
QString
findRepositoryForDirectory
(
const
QString
&
dir
,
const
QString
&
checkFile
);
// Set up the environment for a version control command line call.
// Sets
LANG to 'C' to force English (suppress LOCALE warnings)
//
and sets up SSH graphical password prompting (note that the latter
//
requires a terminal-less process)
.
static
void
setProcessEnvironment
(
QProcessEnvironment
*
e
);
// Sets
up SSH graphical password prompting (note that the latter
//
requires a terminal-less process) and sets LANG to 'C' to force English
//
(suppress LOCALE warnings/parse commands output) if desired
.
static
void
setProcessEnvironment
(
QProcessEnvironment
*
e
,
bool
forceCLocale
);
// Returns whether an SSH prompt is configured.
static
bool
isSshPromptConfigured
();
...
...
@@ -191,7 +191,8 @@ public:
SuppressStdErrInLogWindow
=
0x8
,
// No standard error output to VCS output window.
SuppressFailMessageInLogWindow
=
0x10
,
// No message VCS about failure in VCS output window.
SuppressCommandLogging
=
0x20
,
// No command log entry in VCS output window.
ShowSuccessMessage
=
0x40
// Show message about successful completion in VCS output window.
ShowSuccessMessage
=
0x40
,
// Show message about successful completion in VCS output window.
ForceCLocale
=
0x80
// Force C-locale for commands whose output is parsed.
};
static
Utils
::
SynchronousProcessResponse
...
...
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