@@ -107,9 +107,6 @@ func (bs *baseVCSSource) exportRevisionTo(ctx context.Context, r Revision, to st
107
107
return unwrapVcsErr (err )
108
108
}
109
109
110
- // TODO(sdboyer) this is a simplistic approach and relying on the tools
111
- // themselves might make it faster, but git's the overwhelming case (and has
112
- // its own method) so fine for now
113
110
return fs .CopyDir (bs .repo .LocalPath (), to )
114
111
}
115
112
@@ -353,6 +350,20 @@ type bzrSource struct {
353
350
baseVCSSource
354
351
}
355
352
353
+ func (s * bzrSource ) exportRevisionTo (ctx context.Context , rev Revision , to string ) error {
354
+ // TODO: use bzr instead of the generic approach in
355
+ // baseVCSSource.exportRevisionTo to make it faster.
356
+ if err := s .baseVCSSource .exportRevisionTo (ctx , rev , to ); err != nil {
357
+ return err
358
+ }
359
+
360
+ if err := os .RemoveAll (filepath .Join (to , ".bzr" )); err != nil {
361
+ return err
362
+ }
363
+
364
+ return nil
365
+ }
366
+
356
367
func (s * bzrSource ) listVersions (ctx context.Context ) ([]PairedVersion , error ) {
357
368
r := s .repo
358
369
@@ -403,6 +414,20 @@ type hgSource struct {
403
414
baseVCSSource
404
415
}
405
416
417
+ func (s * hgSource ) exportRevisionTo (ctx context.Context , rev Revision , to string ) error {
418
+ // TODO: use bzr instead of the generic approach in
419
+ // baseVCSSource.exportRevisionTo to make it faster.
420
+ if err := s .baseVCSSource .exportRevisionTo (ctx , rev , to ); err != nil {
421
+ return err
422
+ }
423
+
424
+ if err := os .RemoveAll (filepath .Join (to , ".hg" )); err != nil {
425
+ return err
426
+ }
427
+
428
+ return nil
429
+ }
430
+
406
431
func (s * hgSource ) listVersions (ctx context.Context ) ([]PairedVersion , error ) {
407
432
var vlist []PairedVersion
408
433
0 commit comments