[PATCH 3 of 3] import: show the warning message for failure of merging

Augie Fackler raf at durin42.com
Sat Aug 23 14:23:27 CDT 2014


On Sat, Aug 23, 2014 at 11:17:33PM +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1408802630 -32400
> #      Sat Aug 23 23:03:50 2014 +0900
> # Node ID 587606d1af38ae8c7a314908a225b56457d628b4
> # Parent  3aefe8a4d8172c2733dd0fe3c48d733231aa76fc
> import: show the warning message for failure of merging
>
> Before this patch, no message is shown for failure of merging at "hg
> import".
>
> In such case, merging patch is imported as a normal revision silently,
> and it may confuse users.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -651,6 +651,10 @@
>                      p2 = repo[nullid]
>              except error.RepoError:
>                  p1, p2 = parents
> +            if p2.node() == nullid:
> +                msg = _("warning: import the patch as a normal revision\n"
> +                        "(use '--exact' to import merging patch certainly)\n")

Perhaps "use --exact to import the patch as a merge"?

> +                ui.warn(msg)
>          else:
>              p1, p2 = parents
>
> diff --git a/tests/test-import-merge.t b/tests/test-import-merge.t
> --- a/tests/test-import-merge.t
> +++ b/tests/test-import-merge.t
> @@ -72,6 +72,8 @@
>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ hg import ../merge.diff
>    applying ../merge.diff
> +  warning: import the patch as a normal revision
> +  (use '--exact' to import merging patch certainly)
>    $ tipparents
>    2:890ecaa90481 addc
>    $ hg strip --no-backup tip
> @@ -105,6 +107,8 @@
>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ hg import --bypass ../merge.diff
>    applying ../merge.diff
> +  warning: import the patch as a normal revision
> +  (use '--exact' to import merging patch certainly)
>    $ tipparents
>    2:890ecaa90481 addc
>    $ hg strip --no-backup tip
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list