[PATCH 2 of 3] graft: improve --continue abort message

Augie Fackler raf at durin42.com
Wed Dec 2 09:16:39 CST 2015


On Wed, Dec 02, 2015 at 12:35:08AM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1449038032 0
> #      Wed Dec 02 06:33:52 2015 +0000
> # Node ID 4d20fad83e4bce745f53d837a8199c2ef5b7eb9d
> # Parent  a227e8b8b5b0b180a04b2ca76a0823fe136d44b5
> graft: improve --continue abort message

queued these, thanks!

>
> before, if you ran hg graft --user ... --date ... --log ... revs,
> and if it failed, it would suggest "hg graft --continue",
> but if you did that, your --user / --date / --log options
> were lost, because they were not persisted anywhere...
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -3786,9 +3786,17 @@
>                      # write out state for --continue
>                      nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]]
>                      repo.vfs.write('graftstate', ''.join(nodelines))
> +                    extra = ''
> +                    if opts.get('user'):
> +                        extra += ' --user %s' % opts['user']
> +                    if opts.get('date'):
> +                        extra += ' --date %s' % opts['date']
> +                    if opts.get('log'):
> +                        extra += ' --log'
> +                    hint=_('use hg resolve and hg graft --continue%s') % extra
>                      raise error.Abort(
>                          _("unresolved conflicts, can't continue"),
> -                        hint=_('use hg resolve and hg graft --continue'))
> +                        hint=hint)
>              else:
>                  cont = False
>
> diff --git a/tests/test-graft.t b/tests/test-graft.t
> --- a/tests/test-graft.t
> +++ b/tests/test-graft.t
> @@ -138,7 +138,7 @@
>    grafting 4:9c233e8e184d "4"
>    grafting 3:4c60f11aa304 "3"
>
> -  $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
> +  $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
>    skipping ungraftable merge revision 6
>    scanning for duplicate grafts
>    skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
> @@ -174,6 +174,8 @@
>    e
>    committing manifest
>    committing changelog
> +  $ HGEDITOR=cat hg graft 4 3 --log --debug
> +  scanning for duplicate grafts
>    grafting 4:9c233e8e184d "4"
>      searching for copies back to rev 1
>    resolving manifests
> @@ -192,7 +194,7 @@
>    my e at 1905859650ec+ other e at 9c233e8e184d ancestor e at 68795b066622
>    warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
>    abort: unresolved conflicts, can't continue
> -  (use hg resolve and hg graft --continue)
> +  (use hg resolve and hg graft --continue --log)
>    [255]
>
>  Summary should mention graft:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list