~k.h/bzr-visualstudio/banquet

« back to all changes in this revision

Viewing changes to Bazaar/WorkingTree.cs

  • Committer: Klaus Hartke
  • Date: 2007-06-30 12:46:56 UTC
  • mfrom: (1.1.31 bazaar)
  • Revision ID: klaus.hartke@googlemail.com-20070630124656-m6uuc63qisyxpws6
Merged BazaarSharp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
 
234
234
                                for (int i = 0; i < paths.Length; i++)
235
235
                                {
236
 
                                        string path = FileSpec.Canonicalize(Path.GetFullPath(paths[i]));
 
236
                                        string path = FileSpec.Canonicalize(Path.GetFullPath(paths[i]).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
237
237
                                        CollectUnversionedPaths(FileSpec.MakeRelative(path, BaseDirectory), items);
238
238
                                        if (isRecursive && Directory.Exists(path))
239
239
                                        {
318
318
                                return;
319
319
                        }
320
320
 
321
 
                        string[] paths = Change.ToAbsolutePaths(changes); // TODO: check changes belong to workingtree
 
321
                        string[] paths = FileSpec.MakeRelative(Change.ToAbsolutePaths(changes), BaseDirectory);
322
322
 
323
323
                        try
324
324
                        {
332
332
                                using (PythonBool strict = PythonBool.Create(false))
333
333
                                using (PythonBool verbose = PythonBool.Create(false))
334
334
                                using (PythonNone revprops = PythonNone.Create())
 
335
                                using (PythonBool local = PythonBool.Create(false))
 
336
                                using (PythonNone reporter = PythonNone.Create())
335
337
                                using (PythonModule bzrlib_commit = PythonModule.Import("bzrlib.commit"))
336
338
                                using (PythonClass bzrlib_commit_Commit = bzrlib_commit.GetAttribute<PythonClass>("Commit"))
337
339
                                using (PythonObject commit = bzrlib_commit_Commit.Invoke())
338
 
                                using (commit.InvokeMethod<PythonString>("commit", message, timestamp, timezone, committer, specific_files, rev_id, allow_pointless, strict, verbose, revprops, this.impl)) // TODO: return revision id
 
340
                                using (commit.InvokeMethod<PythonString>("commit", message, timestamp, timezone, committer, specific_files, rev_id, allow_pointless, strict, verbose, revprops, this.impl, local, reporter)) // TODO: return revision id
339
341
                                {
340
342
                                }
341
343
                        }
393
395
 
394
396
                public Change[] GetChanges()
395
397
                {
396
 
                        return GetChanges(null, false, false);
 
398
                        return GetChanges((string[])null, false, false);
397
399
                }
398
400
 
399
401
                public Change[] GetChanges(string[] paths)
401
403
                        return GetChanges(paths, false, false);
402
404
                }
403
405
 
 
406
                public Change[] GetChanges(string path)
 
407
                {
 
408
                        if (path == null)
 
409
                        {
 
410
                                throw new ArgumentNullException("path", Messages.ArgumentNull_Path);
 
411
                        }
 
412
                        if (path.Length == 0)
 
413
                        {
 
414
                                throw new ArgumentException(Messages.Argument_EmptyPath, "path");
 
415
                        }
 
416
 
 
417
                        return GetChanges(new string[] { path }, false, false);
 
418
                }
 
419
 
 
420
                public Change[] GetChanges(bool includeUnchanged, bool includeUnknown)
 
421
                {
 
422
                        return GetChanges((string[])null, includeUnchanged, includeUnknown);
 
423
                }
 
424
 
404
425
                public Change[] GetChanges(string[] paths, bool includeUnchanged, bool includeUnknown)
405
426
                {
406
427
                        if (paths != null)
424
445
                                using (PythonObject specific_files = (paths != null) ? (PythonObject)PythonList.Create(paths) : (PythonObject)PythonNone.Create())
425
446
                                using (PythonNone pb = PythonNone.Create())
426
447
                                using (PythonNone extra_trees = PythonNone.Create())
427
 
                                using (PythonBool require_versioned = PythonBool.Create(true))
 
448
                                using (PythonBool require_versioned = PythonBool.Create(false))
428
449
                                using (PythonBool want_unversioned = PythonBool.Create(includeUnknown))
429
450
                                using (PythonIterable<PythonTuple> _iter_changes = this.impl.InvokeMethod<PythonIterable<PythonTuple>>("_iter_changes", from_tree, include_unchanged, specific_files, pb, extra_trees, require_versioned, want_unversioned))
430
451
                                {
447
468
                        }
448
469
                }
449
470
 
450
 
                public Change[] GetChanges(string path)
 
471
                public Change[] GetChanges(string path, bool includeUnchanged, bool includeUnknown)
451
472
                {
452
473
                        if (path == null)
453
474
                        {
458
479
                                throw new ArgumentException(Messages.Argument_EmptyPath, "path");
459
480
                        }
460
481
 
461
 
                        return GetChanges(new string[] { path }, false, false);
 
482
                        return GetChanges(new string[] { path }, includeUnchanged, includeUnknown);
462
483
                }
463
484
 
464
485
                public Conflict[] GetConflicts()