jdalrymple/node-hg-plus

Expected to expose HgRepo or Hg.getRepo()

Closed this issue · 1 comments

It is a common situation that there has been a cloned repo in local, then I need to pull and update the repo. What I need is a HgRepo instance.

However, Hg.clone is wasteful and Hg.create goes with repo.init which leads to an error.

Maybe it's a good idea to expose HgRepo or Hg.getRepo() to get the HgRepo instance.

const repo = new HgRepo({
       name: 'name',
       path: 'my/local/cloned/repo'
})
await repo.pull()

or

const repo = Hg.getRepo({
     name: 'name',
     path: 'my/local/cloned/repo'
})
await repo.pull()