File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using ScmBackup . Http ;
22using System ;
33using System . IO ;
4- using System . Text . RegularExpressions ;
54
65namespace ScmBackup . Scm
76{
@@ -37,7 +36,7 @@ public override bool IsOnThisComputer()
3736 {
3837 var result = this . ExecuteCommand ( "version" ) ;
3938
40- if ( result . Successful && result . StandardOutput . ToLower ( ) . Contains ( "mercurial distributed scm " ) )
39+ if ( result . Successful && result . StandardOutput . ToLower ( ) . Contains ( "mercurial" ) )
4140 {
4241 return true ;
4342 }
@@ -47,17 +46,11 @@ public override bool IsOnThisComputer()
4746
4847 public override string GetVersionNumber ( )
4948 {
50- var result = this . ExecuteCommand ( "version" ) ;
49+ var result = this . ExecuteCommand ( "version -T {ver} " ) ;
5150
5251 if ( result . Successful )
5352 {
54- string pattern = @"mercurial distributed scm \(version (.*)\)" ;
55- var regex = new Regex ( pattern , RegexOptions . IgnoreCase ) ;
56- var match = regex . Match ( result . StandardOutput ) ;
57- if ( match . Success )
58- {
59- return match . Groups [ 1 ] . ToString ( ) ;
60- }
53+ return result . StandardOutput ;
6154 }
6255
6356 throw new InvalidOperationException ( result . Output ) ;
You can’t perform that action at this time.
0 commit comments