[PATCH] convert: record the source revision in the changelog

Alexis S. L. Carvalho alexis at cecm.usp.br
Fri Jul 13 04:47:11 CDT 2007


Thus spake Brendan Cully:
> diff --git a/hgext/convert/git.py b/hgext/convert/git.py
> --- a/hgext/convert/git.py
> +++ b/hgext/convert/git.py
> @@ -80,7 +80,8 @@ class convert_git(converter_source):
>          date = tm + " " + str(tz)
>          author = author or "unknown"
>  
> -        c = commit(parents=parents, date=date, author=author, desc=message)
> +        c = commit(parents=parents, date=date, author=author, desc=message,
> +                   rev = version)

Too many spaces.

>          return c
>  
>      def gettags(self):
> diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
> --- a/hgext/convert/hg.py
> +++ b/hgext/convert/hg.py
> @@ -54,11 +54,11 @@ class convert_mercurial(converter_sink):
>  
>          text = commit.desc
>          extra = {}
> -        try:
> -            extra["branch"] = commit.branch
> -        except AttributeError:
> -            pass
> -
> +        if commit.branch:
> +            extra['branch'] = commit.branch
> +        if commit.rev:
> +            extra['source_revision'] = commit.rev

At the time transplant_source was added, we sort of agreed on
"<extensionprefix>_<field>".

Some questions:

- do we have something useful for the CVS backend here?

- if so, should we just just set commit.rev in the generic code?  OTOH
  this wouldn't allow a backend to avoid adding this field...

- should we also save the name of the source SCM?

Alexis


More information about the Mercurial-devel mailing list