[PATCH] convert: .hgtags files contain SKIP lines (issue3736)
Mads Kiilerich
mads at kiilerich.com
Wed Dec 26 15:37:06 CST 2012
John Peacock wrote, On 12/26/2012 07:14 PM:
> # HG changeset patch
> # User John Peacock <john.peacock at messagesystems.com>
> # Date 1356542038 18000
> # Branch bugfix/3736
> # Node ID 0198939c241c0ed4f6ba40196e24f36eb85aea56
> # Parent 730b769fb6347d8da3c9e0674e7133bdf61d7a36
> convert: .hgtags files contain SKIP lines (issue3736)
>
> convert is writing SKIP lines into the various .hgtags files when a
> tag corresponds to a revision marked to be skipped in the conversion
> (e.g. with filemap). These lines should only be maintained in the
> shamap file, not in the .hgtags (where they emit unhelpful warnings).
> Minimal patch to ignore SKIP lines when updating the .hgtags files.
Please try to phrase the patch description as a description of the patch
and the solution. It might be a good idea to include a description of
the problem, but it should make it clear when it is describing the
previous bad behaviour and when it is describing the new and better
behaviour.
Please also try to include a test in the patch. Tweak one of the
existing convert tests in such a way that it would demonstrate the
problem if the fix was left out.
/Mads
>
> diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
> --- a/hgext/convert/hg.py
> +++ b/hgext/convert/hg.py
> @@ -23,7 +23,7 @@
> from mercurial.node import bin, hex, nullid
> from mercurial import hg, util, context, bookmarks, error
>
> -from common import NoRepo, commit, converter_source, converter_sink
> +from common import SKIPREV, NoRepo, commit, converter_source, converter_sink
>
> class mercurial_sink(converter_sink):
> def __init__(self, ui, path):
> @@ -126,6 +126,8 @@
> revid = revmap.get(source.lookuprev(s[0]))
> if not revid:
> continue
> + if revid == SKIPREV:
> + continue
> fp.write('%s %s\n' % (revid, s[1]))
> return fp.getvalue()
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list