grim/govcs

Correctly support hg remotes
draft
2017-12-05, Gary Kramlich
164e2634eddc
Parents 77caf60cb0bf
Children 555c1d4bc08b
Correctly support hg remotes
  • +1 -2
    hg/hg.go
  • +2 -2
    hg/hg_test.go
  • --- a/hg/hg.go Tue Dec 05 22:15:21 2017 -0600
    +++ b/hg/hg.go Tue Dec 05 22:48:01 2017 -0600
    @@ -57,8 +57,7 @@
    remotes := m.Config("paths." + name)
    if len(remotes) == 1 {
    - parts := strings.SplitN(remotes[0], "=", 2)
    - return parts[1]
    + return remotes[0]
    }
    return ""
    --- a/hg/hg_test.go Tue Dec 05 22:15:21 2017 -0600
    +++ b/hg/hg_test.go Tue Dec 05 22:48:01 2017 -0600
    @@ -70,7 +70,7 @@
    }
    func (s *hgSuite) TestRemoteEmpty(t sweet.T) {
    - backend := s.setup(exec.NewMockCommand("paths.default=mypath\n", nil))
    + backend := s.setup(exec.NewMockCommand("mypath\n", nil))
    defer exec.SetBackend(backend)
    hg := Mercurial{}
    @@ -79,7 +79,7 @@
    }
    func (s *hgSuite) TestRemoteNamed(t sweet.T) {
    - backend := s.setup(exec.NewMockCommand("paths.upstream=myupstream\n", nil))
    + backend := s.setup(exec.NewMockCommand("myupstream\n", nil))
    defer exec.SetBackend(backend)
    hg := Mercurial{}