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
Marco Bubke
flatpak-qt-creator
Commits
c56b56be
Commit
c56b56be
authored
Mar 01, 2010
by
Friedemann Kleint
Browse files
VCS: Minor fixes
- git status: Recognize text in case -u was passed - Mercurial: Always run in C locale
parent
a0b11de0
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/git/gitclient.cpp
View file @
c56b56be
...
...
@@ -1147,8 +1147,9 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory,
}
return
StatusFailed
;
}
// Unchanged?
if
(
outputText
.
contains
(
"nothing to commit"
))
// Unchanged (output text depending on whether -u was passed)
if
(
outputText
.
contains
(
"nothing to commit"
)
||
outputText
.
contains
(
"nothing added to commit but untracked files present"
))
return
StatusUnchanged
;
return
StatusChanged
;
}
...
...
src/plugins/mercurial/mercurialclient.cpp
View file @
c56b56be
...
...
@@ -121,6 +121,7 @@ bool MercurialClient::executeHgSynchronously(const QString &workingDir,
QProcess
hgProcess
;
if
(
!
workingDir
.
isEmpty
())
hgProcess
.
setWorkingDirectory
(
workingDir
);
MercurialJobRunner
::
setProcessEnvironment
(
hgProcess
);
const
MercurialSettings
&
settings
=
MercurialPlugin
::
instance
()
->
settings
();
const
QString
binary
=
settings
.
binary
();
...
...
src/plugins/mercurial/mercurialjobrunner.cpp
View file @
c56b56be
...
...
@@ -37,6 +37,7 @@
#include
<utils/synchronousprocess.h>
#include
<QtCore/QProcess>
#include
<QtCore/QProcessEnvironment>
#include
<QtCore/QString>
#include
<QtCore/QDebug>
...
...
@@ -161,6 +162,16 @@ QString MercurialJobRunner::msgTimeout(int timeoutSeconds)
return
tr
(
"Timed out after %1s waiting for mercurial process to finish."
).
arg
(
timeoutSeconds
);
}
// Set environment for a hg process to run in locale "C". Note that there appears
// to be a bug in hg that causes special characters to be garbled when running
// in a different language, which seems to be independent from the encoding.
void
MercurialJobRunner
::
setProcessEnvironment
(
QProcess
&
p
)
{
QProcessEnvironment
env
=
QProcessEnvironment
::
systemEnvironment
();
env
.
insert
(
QLatin1String
(
"LANG"
),
QString
(
QLatin1Char
(
'C'
)));
p
.
setProcessEnvironment
(
env
);
}
void
MercurialJobRunner
::
task
(
const
QSharedPointer
<
HgTask
>
&
job
)
{
HgTask
*
taskData
=
job
.
data
();
...
...
@@ -193,7 +204,7 @@ void MercurialJobRunner::task(const QSharedPointer<HgTask> &job)
QProcess
hgProcess
;
hgProcess
.
setWorkingDirectory
(
taskData
->
repositoryRoot
());
MercurialJobRunner
::
setProcessEnvironment
(
hgProcess
);
hgProcess
.
start
(
binary
,
args
);
...
...
src/plugins/mercurial/mercurialjobrunner.h
View file @
c56b56be
...
...
@@ -39,6 +39,10 @@
#include
<QtCore/QVariant>
#include
<QtCore/QString>
QT_BEGIN_NAMESPACE
class
QProcess
;
QT_END_NAMESPACE
namespace
VCSBase
{
class
VCSBaseEditor
;
}
...
...
@@ -95,6 +99,9 @@ public:
static
QString
msgStartFailed
(
const
QString
&
binary
,
const
QString
&
why
);
static
QString
msgTimeout
(
int
timeoutSeconds
);
// Set environment for a hg process to run in locale "C"
static
void
setProcessEnvironment
(
QProcess
&
p
);
protected:
void
run
();
...
...
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