Introduce a more subtle concept of validity when it comes to revision
indentifiers in IDF - the SCM function isValidRevision has been replaced by a validateRevision() method which returns one of three states, valid, invalid or ambiguous. The source view can then act accordingly and display disambiguate view for the latter, so the user can select for which revision he actually wants to execute the requested action. Also, invalid revisions now lead to another separate view, telling the user that it is invalid / does not exist and pointing him optionally to the help page where he can read further how to access his repository to push the first changes into. (partially resolves issue 525)
This commit is contained in:
@@ -138,7 +138,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
/**
|
||||
* Subversion revisions are either a number or 'HEAD'.
|
||||
*/
|
||||
public function isValidRevision($rev)
|
||||
public function validateRevision($rev)
|
||||
{
|
||||
if ($rev == 'HEAD') {
|
||||
return true;
|
||||
@@ -149,8 +149,11 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($rev));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Svn::isValidRevision', $cmd, $out, $ret);
|
||||
return (0 == $ret);
|
||||
self::exec('IDF_Scm_Svn::validateRevision', $cmd, $out, $ret);
|
||||
|
||||
if ($ret == 0)
|
||||
return IDF_Scm::REVISION_VALID;
|
||||
return IDF_Scm::REVISION_INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user