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

Commit 99c6e24

Browse files
committed
Ensure local repo exists in bzr/hg before running
This is a quick hack; it needs proper handling in the gateway's FSM.
1 parent 9a8f9ec commit 99c6e24

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

gps/vcs_source.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ type bzrSource struct {
351351
func (s *bzrSource) listVersions(ctx context.Context) ([]PairedVersion, error) {
352352
r := s.repo
353353

354+
// TODO(sdboyer) this should be handled through the gateway's FSM
355+
if !r.CheckLocal() {
356+
err := s.initLocal(ctx)
357+
if err != nil {
358+
return nil, err
359+
}
360+
}
361+
354362
// Now, list all the tags
355363
out, err := runFromRepoDir(ctx, r, "bzr", "tags", "--show-ids", "-v")
356364
if err != nil {
@@ -394,6 +402,14 @@ func (s *hgSource) listVersions(ctx context.Context) ([]PairedVersion, error) {
394402
var vlist []PairedVersion
395403

396404
r := s.repo
405+
// TODO(sdboyer) this should be handled through the gateway's FSM
406+
if !r.CheckLocal() {
407+
err := s.initLocal(ctx)
408+
if err != nil {
409+
return nil, err
410+
}
411+
}
412+
397413
// Now, list all the tags
398414
out, err := runFromRepoDir(ctx, r, "hg", "tags", "--debug", "--verbose")
399415
if err != nil {

0 commit comments

Comments
 (0)