~monodevelop-bzr/monodevelop-bzr/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
// Copyright (C) 2008 by Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
//        
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//    
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//   
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;
using System.Collections.Generic;

using MonoDevelop.Core;

namespace MonoDevelop.VersionControl.Bazaar
{
	public interface IBazaarClient
	{
		/// <summary>
		/// Checks whether Bazaar support is installed
		/// </summary>
		bool CheckInstalled ();

		/// <value>
		/// The installed version of Bazaar
		/// </value>
		string Version{ get; }

		/// <summary>
		/// Lists files in a version-controlled path
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: The path to list
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to list recursively
		/// </param>
		/// <param name="kind">
		/// A <see cref="ListKind"/>: The kind of files to list
		/// </param>
		/// <returns>
		/// A <see cref="IList`1"/> of filenames
		/// </returns>
		IList<string> List (string path, bool recurse, ListKind kind);

		/// <summary>
		/// Gets the status of a path at a revision
		/// </summary>
		/// <returns>
		/// A <see cref="IList`1"/>: The list of statuses applying to that path
		/// </returns>
		IList<LocalStatus> Status (string path, BazaarRevision revision);

		/// <summary>
		/// Checks whether a path is versioned
		/// </summary>
		bool IsVersioned (string path);

		/// <summary>
		/// Gets the root url for a path
		/// </summary>
		string GetPathUrl (string path);

		/// <summary>
		/// Updates a local path
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The path to update
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to update recursively
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Update (string localPath, bool recurse, IProgressMonitor monitor);

		/// <summary>
		/// Reverts a local path
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The path to revert
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to revert recursively
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		/// <param name="toRevision">
		/// A <see cref="BazaarRevision"/> to which to revert
		/// </param>
		void Revert (string localPath, bool recurse, IProgressMonitor monitor, BazaarRevision toRevision);

		/// <summary>
		/// Adds a local path
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The path to add
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to add recursively
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Add (string localPath, bool recurse, IProgressMonitor monitor);

		/// <summary>
		/// Perform a checkout
		/// </summary>
		/// <param name="url">
		/// A <see cref="System.String"/>: The URI from which to check out
		/// </param>
		/// <param name="targetLocalPath">
		/// A <see cref="System.String"/>: The local path to be used
		/// </param>
		/// <param name="rev">
		/// A <see cref="BazaarRevision"/>: The revision to check out
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to check out recursively
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Checkout (string url, string targetLocalPath, BazaarRevision rev, bool recurse, IProgressMonitor monitor);

		/// <summary>
		/// Perform a branching operation
		/// </summary>
		/// <param name="branchLocation">
		/// A <see cref="System.String"/>: The branch location from which to branch
		/// </param>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The location to which to branch
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Branch (string branchLocation, string localPath, IProgressMonitor monitor);

		/// <summary>
		/// Get a file's text at a given revision
		/// </summary>
		string GetTextAtRevision (string path, BazaarRevision rev);

		/// <summary>
		/// Get the history for a given file
		/// </summary>
		/// <param name="repo">
		/// A <see cref="BazaarRepository"/>: The repo to which the file belongs
		/// </param>
		/// <param name="localFile">
		/// A <see cref="System.String"/>: The filename
		/// </param>
		/// <param name="since">
		/// A <see cref="BazaarRevision"/>: The revision since which to get the file's history
		/// </param>
		/// <returns>
		/// A <see cref="BazaarRevision[]"/>: The revisions which have affected localFile since since
		/// </returns>
		BazaarRevision[] GetHistory (BazaarRepository repo, string localFile, BazaarRevision since);
		
		/// <summary>
		/// Performs a merge
		/// </summary>
		/// <param name="mergeLocation">
		/// A <see cref="System.String"/>: The path from which to merge
		/// </param>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The path to which to merge
		/// </param>
		/// <param name="remember">
		/// A <see cref="System.Boolean"/>: Whether mergeLocation should be remembered
		/// </param>
		/// <param name="overwrite">
		/// A <see cref="System.Boolean"/>: Whether to overwrite uncommitted changes at localPath
		/// </param>
		/// <param name="start">
		/// A <see cref="BazaarRevision"/>: The revision to begin merging
		/// </param>
		/// <param name="end">
		/// A <see cref="BazaarRevision"/>: The revision to stop merging
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to use
		/// </param>
		void Merge (string mergeLocation, string localPath, bool remember, bool overwrite, BazaarRevision start, BazaarRevision end, IProgressMonitor monitor);

		/// <summary>
		/// Performs a push
		/// </summary>
		/// <param name="pushLocation">
		/// A <see cref="System.String"/>: The branch URI to which to push
		/// </param>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The local path to push
		/// </param>
		/// <param name="remember">
		/// A <see cref="System.Boolean"/>: Whether pushLocation should be remembered
		/// </param>
		/// <param name="overwrite">
		/// A <see cref="System.Boolean"/>: Whether to overwrite stale changes at pushLocation
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Push (string pushLocation, string localPath, bool remember, bool overwrite, IProgressMonitor monitor);

		/// <summary>
		/// Performs a push
		/// </summary>
		/// <param name="pushLocation">
		/// A <see cref="System.String"/>: The branch URI to which to push
		/// </param>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The local path to push
		/// </param>
		/// <param name="remember">
		/// A <see cref="System.Boolean"/>: Whether pushLocation should be remembered
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void DPush (string pushLocation, string localPath, bool remember, MonoDevelop.Core.IProgressMonitor monitor);
		
		/// <summary>
		/// Performs a pull
		/// </summary>
		/// <param name="pullLocation">
		/// A <see cref="System.String"/>: The branch URI to pull
		/// </param>
		/// <param name="LocalPath">
		/// A <see cref="System.String"/>: The local path to which to pull
		/// </param>
		/// <param name="remember">
		/// A <see cref="System.Boolean"/>: Whether to remember this pull location
		/// </param>
		/// <param name="overwrite">
		/// A <see cref="System.Boolean"/>: Whether to overwrite local changes
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Pull (string pullLocation, string LocalPath, bool remember, bool overwrite, IProgressMonitor monitor);

		/// <summary>
		/// Performs a commit
		/// </summary>
		void Commit (ChangeSet changeSet, IProgressMonitor monitor);

		/// <summary>
		/// Performs a diff
		/// </summary>
		/// <param name="basePath">
		/// A <see cref="System.String"/>: The base path to be diffed
		/// </param>
		/// <param name="files">
		/// A <see cref="System.String"/>: An array of files to be diffed,
		/// if not all
		/// </param>
		/// <returns>
		/// A <see cref="DiffInfo"/>: The differences
		/// </returns>
		DiffInfo[] Diff (string basePath, string[] files);

		/// <summary>
		/// Removes a path
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: The path to be removed
		/// </param>
		/// <param name="force">
		/// A <see cref="System.Boolean"/>: Whether to force the removal
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Remove (string path, bool force, IProgressMonitor monitor);

		/// <summary>
		/// Resolves a conflicted path
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: The path to be resolved
		/// </param>
		/// <param name="recurse">
		/// A <see cref="System.Boolean"/>: Whether to recurse
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>: The progress monitor to be used
		/// </param>
		void Resolve (string path, bool recurse, IProgressMonitor monitor);

		/// <summary>
		/// Gets a list of the known branches for path
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: A path to a version-controlled location
		/// </param>
		/// <returns>
		/// A <see cref="Dictionary"/>: Known branch paths and their types
		/// </returns>
		Dictionary<string, BranchType> GetKnownBranches (string path);
		
		/// <summary>
		/// Stores credentials for a given url
		/// </summary>
		/// <param name="url">
		/// A <see cref="System.String"/>: A url of the form: 
		/// transport://[[user[:password]@]host[:port]]/path
		/// </param>
		void StoreCredentials (string url);
		
		/// <summary>
		/// Make a directory into a versioned branch.
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: The path at which to create the branch
		/// </param>
		void Init (string path);
		
		/// <summary>
		/// Ignore specified file.
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: The file to ignore
		/// </param>
		void Ignore (string path);
		
		/// <summary>
		/// Determines whether a path's branch is bound.
		/// </summary>
		bool IsBound (string path);
		
		/// <summary>
		/// Gets the branch bound to the current path, 
		/// or the branch that would be bound if the branch were bound.
		/// </summary>
		/// <param name="path">
		/// A <see cref="System.String"/>: A path contained in a local branch
		/// </param>
		/// <returns>
		/// A <see cref="System.String"/>: The bound branch url, or empty string if none
		/// </returns>
		string GetBoundBranch (string path);
		
		/// <summary>
		/// Convert a local branch into a checkout of the supplied branch.
		/// </summary>
		/// <param name="branchUrl">
		/// A <see cref="System.String"/>: The url of the branch to bind
		/// </param>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The local branch
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>
		/// </param>
		void Bind (string branchUrl, string localPath, IProgressMonitor monitor);
		
		/// <summary>
		/// Convert a local checkout into a regular branch.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The local checkout
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>
		/// </param>
		void Unbind (string localPath, IProgressMonitor monitor);
		
		/// <summary>
		/// Remove the last committed revision.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: A path to a branch from which to uncommit
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>
		/// </param>
		void Uncommit (string localPath, IProgressMonitor monitor);
		
		/// <summary>
		/// Get the origin of each line in a file.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The local file path
		/// </param>
		/// <returns>
		/// A <see cref="System.String"/> for each line in the file at localPath
		/// </returns>
		string[] GetAnnotations (string localPath);
		
		/// <summary>
		/// Export a (portion of a) local tree.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: The path to be exported.
		/// </param>
		/// <param name="exportPath">
		/// A <see cref="System.String"/>: The output path.
		/// </param>
		/// <param name="monitor">
		/// A <see cref="IProgressMonitor"/>
		/// </param>
		void Export (string localPath, string exportPath, IProgressMonitor monitor);
		
		/// <summary>
		/// Determines whether the current working tree has 
		/// a merge pending commit.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="System.String"/>: A path in the local working tree
		/// </param>
		/// <returns>
		/// A <see cref="System.Boolean"/>: Whether a merge is pending
		/// </returns>
		bool IsMergePending (string localPath);
		
		/// <summary>
		/// Whether the rebase plugin is installed
		/// </summary>
		bool CanRebase ();
	}
}