~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
{
12
12
        public abstract class SubversionVersionControl : VersionControlSystem
13
13
        {
14
 
                public override string Name {
 
14
                internal static string GetTextBase(string sourcefile)
 
15
                {
 
16
                        return Path.Combine (Path.GetDirectoryName(sourcefile), ".svn", "text-base", Path.GetFileName(sourcefile) + ".svn-base");
 
17
                }
 
18
                
 
19
                internal static string GetDirectoryDotSvn (string sourcepath)
 
20
                {
 
21
                        return Path.Combine(sourcepath, ".svn");
 
22
                }
 
23
 
 
24
                internal static bool IsVersioned (FilePath sourcefile)
 
25
                {
 
26
                        return File.Exists (GetTextBase (sourcefile)) || Directory.Exists (GetDirectoryDotSvn (sourcefile));
 
27
                }
 
28
 
 
29
                public override string Name
 
30
                {
15
31
                        get { return "Subversion"; }
16
32
                }
17
 
                
18
 
                protected override Repository OnCreateRepositoryInstance ()
19
 
                {
20
 
                        return new SubversionRepository ();
21
 
                }
22
 
                
23
 
                public override IRepositoryEditor CreateRepositoryEditor (Repository repo)
24
 
                {
25
 
                        return new UrlBasedRepositoryEditor ((SubversionRepository)repo);
26
 
                }
27
 
 
 
33
 
 
34
                public abstract SubversionBackend CreateBackend ();
 
35
                
 
36
                public abstract string GetPathUrl (FilePath path);
 
37
 
28
38
                public override Repository GetRepositoryReference (FilePath path, string id)
29
39
                {
30
40
                        try {
37
47
                                LoggingService.LogError (ex.ToString ());
38
48
                                return null;
39
49
                        }
40
 
                }
41
 
 
42
 
                public override void StoreRepositoryReference (Repository repo, FilePath path, string id)
43
 
                {
44
 
                        // Nothing to do
45
 
                }
46
 
                
47
 
                string GetTextBase(string sourcefile) {
48
 
                        return Path.Combine(
49
 
                                Path.Combine(
50
 
                                        Path.Combine(
51
 
                                                Path.GetDirectoryName(sourcefile),
52
 
                                                 ".svn"),
53
 
                                        "text-base"),
54
 
                                Path.GetFileName(sourcefile) + ".svn-base"); 
55
 
                }
56
 
        
57
 
                internal static string GetDirectoryDotSvn (string sourcepath) {
58
 
                        return Path.Combine(sourcepath, ".svn");
59
 
                }
60
 
                
61
 
                public bool IsVersioned (FilePath sourcefile)
62
 
                {
63
 
                        return File.Exists (GetTextBase (sourcefile))
64
 
                                || Directory.Exists (GetDirectoryDotSvn (sourcefile));
65
 
                }
 
50
                }
 
51
 
 
52
                protected override Repository OnCreateRepositoryInstance ()
 
53
                {
 
54
                        return new SubversionRepository ();
 
55
                }
 
56
                
 
57
                public override IRepositoryEditor CreateRepositoryEditor (Repository repo)
 
58
                {
 
59
                        return new UrlBasedRepositoryEditor ((SubversionRepository)repo);
 
60
                }
 
61
        }
 
62
 
 
63
        public abstract class SubversionBackend
 
64
        {
 
65
                string GetTextBase (string sourcefile)
 
66
                {
 
67
                        return SubversionVersionControl.GetTextBase (sourcefile);
 
68
                }
 
69
                
 
70
                string GetDirectoryDotSvn (string sourcepath)
 
71
                {
 
72
                        return SubversionVersionControl.GetDirectoryDotSvn (sourcepath);
 
73
                }
66
74
 
67
75
                public string GetPathToBaseText (FilePath sourcefile) {
68
76
                        return GetTextBase (sourcefile);
84
92
                }
85
93
 
86
94
                public abstract IEnumerable<SvnRevision> Log (Repository repo, FilePath path, SvnRevision revisionStart, SvnRevision revisionEnd);
87
 
                
 
95
 
 
96
                /// <summary>
 
97
                /// Returns the text for a file at a particular revision. If the file is binary, 'null' is returned
 
98
                /// </summary>
 
99
                /// <returns>
 
100
                /// The text at revision or 'null' if the file is binary.
 
101
                /// </returns>
 
102
                /// <param name='repositoryPath'>
 
103
                /// Repository path.
 
104
                /// </param>
 
105
                /// <param name='revision'>
 
106
                /// Revision.
 
107
                /// </param>
88
108
                public abstract string GetTextAtRevision (string repositoryPath, Revision revision);
89
109
                
90
110
                internal protected virtual VersionControlOperation GetSupportedOperations (Repository repo, VersionInfo vinfo, VersionControlOperation defaultValue)
221
241
                
222
242
                public abstract string GetVersion ();
223
243
 
224
 
                public abstract string GetPathUrl (FilePath path);
225
 
 
226
 
 
227
244
                static protected bool SimpleAuthenticationPrompt (string realm, bool may_save, ref string user_name, out string password, out bool save)
228
245
                {
229
246
                        return UserPasswordDialog.Show (true, realm, may_save, ref user_name, out password, out save);