Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit a8650d3

Browse files
committed
internal/gps: remove vcs (bzr & hg) directories from vendor/
Fixes #887 Signed-off-by: Ibrahim AshShohail <[email protected]>
1 parent 0a63c47 commit a8650d3

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

internal/gps/vcs_source.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ func (bs *baseVCSSource) exportRevisionTo(ctx context.Context, r Revision, to st
107107
return unwrapVcsErr(err)
108108
}
109109

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
113110
return fs.CopyDir(bs.repo.LocalPath(), to)
114111
}
115112

@@ -353,6 +350,20 @@ type bzrSource struct {
353350
baseVCSSource
354351
}
355352

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+
356367
func (s *bzrSource) listVersions(ctx context.Context) ([]PairedVersion, error) {
357368
r := s.repo
358369

@@ -403,6 +414,20 @@ type hgSource struct {
403414
baseVCSSource
404415
}
405416

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+
406431
func (s *hgSource) listVersions(ctx context.Context) ([]PairedVersion, error) {
407432
var vlist []PairedVersion
408433

0 commit comments

Comments
 (0)