Bug 374904

Summary: Error cases of sub-jobs in MercurialPushJob and MercurialAnnotateJob not handled properly
Product: [Developer tools] kdevplatform Reporter: Frank Fischer <frank-fischer>
Component: mercurialAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: minor CC: frank-fischer, kalinichev.so.0
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Frank Fischer 2017-01-11 08:54:45 UTC
The signals `readyForParsing` as well as `resultsReady` of a DVcsJob might only be emitted if the process exits normally, i.e. if the process does not crash, if it exits with code 0 or if it exits with some code != 0 and DVcsJob::setIgnoreError(false) had been called (because of the implementation of DVcsJob::slotProcessExited). However, the class MercurialPushJob only connects to the signal `readyForParsing`, thus it may not recognize if one of the sub-jobs crashed/fails.

I suggest to connect to the signal `KJob::finished` in all cases to catch errors properly (and call MercurialPushJob::setFail() then).

I think the same problem exists in MercurialAnnotateJob.
Comment 1 Sergey Kalinichev 2017-01-17 15:46:40 UTC
Git commit 6fd88c79fd657034f872b331a399b45f07885c2d by Sergey Kalinichev.
Committed on 16/01/2017 at 18:10.
Pushed by vpuhov into branch 'master'.

Handle error cases of sub-jobs

Spotted by Frank Fischer

M  +40   -11   mercurialannotatejob.cpp
M  +14   -0    mercurialannotatejob.h
M  +5    -6    mercurialpushjob.cpp
M  +1    -1    mercurialpushjob.h
M  +22   -0    tests/test_mercurial.cpp
M  +1    -0    tests/test_mercurial.h

https://commits.kde.org/kdev-mercurial/6fd88c79fd657034f872b331a399b45f07885c2d