[PATCH] convert: fetch all heads of a git repository

Matt Mackall mpm at selenic.com
Sun Jul 1 16:03:45 CDT 2007


On Sun, Jul 01, 2007 at 01:41:29PM -0700, Brendan Cully wrote:
> # HG changeset patch
> # User Brendan Cully <brendan at kublai.com>
> # Date 1183322471 25200
> # Node ID e6f7abdd86521b5a149a78b7d25b7d23653c20d5
> # Parent  20ec5cc02f1878e6dbb52d2c49b7ad39029a7a3b
> convert: fetch all heads of a git repository
> 
> diff --git a/hgext/convert/git.py b/hgext/convert/git.py
> --- a/hgext/convert/git.py
> +++ b/hgext/convert/git.py
> @@ -16,8 +16,9 @@ class convert_git(converter_source):
>          self.encoding = 'utf-8'
>  
>      def getheads(self):
> -        fh = os.popen("GIT_DIR=%s git-rev-parse --verify HEAD" % self.path)
> -        return [fh.read()[:-1]]
> +        fh = os.popen("GIT_DIR=%s git-rev-parse --branches" % self.path)
> +        heads = fh.read().splitlines()
> +        return heads

Looks good.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list