@@ -891,13 +891,30 @@ - (BOOL) deleteRef:(PBGitRef *)ref
891
891
determines if the current repository has a git-svn configured remote
892
892
*/
893
893
- (BOOL ) hasSvnRemote
894
+ {
895
+ NSArray * remotes = [self svnRemotes ];
896
+ return remotes && [remotes count ] > 0 ;
897
+ }
898
+
899
+ /* *
900
+ get a list of the svn remotes configured on this repository
901
+ */
902
+ - (NSArray *) svnRemotes
894
903
{
895
904
NSDictionary * configValues = [config listConfigValuesInDir: [self workingDirectory ]];
905
+ NSMutableArray * remotes = [NSMutableArray array ];
896
906
897
907
for (NSString * key in configValues) {
898
- if ([key hasPrefix: @" svn-remote." ]) return YES ;
908
+ NSArray * components = [key componentsSeparatedByString: @" ." ];
909
+ if ([components count ] == 3 &&
910
+ [[components objectAtIndex: 0 ] isEqualToString: @" svn-remote" ] &&
911
+ [[components objectAtIndex: 2 ] isEqualToString: @" url" ]) {
912
+
913
+ NSString * remoteName = [components objectAtIndex: 1 ];
914
+ [remotes addObject: remoteName];
915
+ }
899
916
}
900
- return NO ;
917
+ return [ NSArray arrayWithArray: remotes] ;
901
918
}
902
919
903
920
/* *
@@ -907,7 +924,15 @@ - (BOOL) hasSvnRemote
907
924
*/
908
925
- (BOOL ) svnFetch : (NSString *)remoteName
909
926
{
910
- return YES ;
927
+ int retval = 1 ;
928
+ NSArray * args = [NSArray arrayWithObjects: @" svn" , @" fetch" , remoteName, nil ];
929
+
930
+ NSString *description = [NSString stringWithFormat: @" Fetching all tracking branches from %@ " , remoteName ? remoteName : @" <default>" ];
931
+ NSString *title = @" Fetching from svn remote" ;
932
+ [PBRemoteProgressSheet beginRemoteProgressSheetForArguments: args title: title description: description inRepository: self ];
933
+ retval = 0 ;
934
+
935
+ return retval == 0 ;
911
936
}
912
937
913
938
/* *
@@ -917,7 +942,15 @@ - (BOOL) svnFetch:(NSString*)remoteName
917
942
*/
918
943
- (BOOL ) svnRebase : (NSString *)remoteName
919
944
{
920
- return YES ;
945
+ int retval = 1 ;
946
+ NSArray * args = [NSArray arrayWithObjects: @" svn" , @" rebase" , remoteName, nil ];
947
+
948
+ NSString *description = [NSString stringWithFormat: @" Rebasing all tracking branches from %@ " , remoteName ? remoteName : @" <default>" ];
949
+ NSString *title = @" Pulling from svn remote (Rebase)" ;
950
+ [PBRemoteProgressSheet beginRemoteProgressSheetForArguments: args title: title description: description inRepository: self ];
951
+ retval = 0 ;
952
+
953
+ return retval == 0 ;
921
954
}
922
955
923
956
/* *
@@ -927,7 +960,15 @@ - (BOOL) svnRebase:(NSString*)remoteName
927
960
*/
928
961
- (BOOL ) svnDcommit : (NSString *)commitURL
929
962
{
930
- return YES ;
963
+ int retval = 1 ;
964
+ NSArray * args = [NSArray arrayWithObjects: @" svn" , @" dcommit" , commitURL, nil ];
965
+
966
+ NSString *description = [NSString stringWithFormat: @" Pushing commits to svn remote %@ " , commitURL ? commitURL : @" <default>" ];
967
+ NSString *title = @" Pushing to svn remote (Dcommit)" ;
968
+ [PBRemoteProgressSheet beginRemoteProgressSheetForArguments: args title: title description: description inRepository: self ];
969
+ retval = 0 ;
970
+
971
+ return retval == 0 ;
931
972
}
932
973
933
974
#pragma mark GitX Scripting
0 commit comments