[PATCH] merge: warn about adding unstable commit

Augie Fackler raf at durin42.com
Tue Dec 29 17:21:22 CST 2015


On Mon, Dec 28, 2015 at 01:49:44PM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1451330894 0
> #      Mon Dec 28 19:28:14 2015 +0000
> # Node ID 6b68288cf77cefcea45e168c6bf85cc86f5db52c
> # Parent  23541bdd1610c08af247f9c8719045cf247ce541
> merge: warn about adding unstable commit
>

+1

>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -5202,6 +5202,8 @@
>          displayer.close()
>          return 0
>
> +    if len(repo.revs('(. + %s) and (obsolete() or unstable())' % repo[node])):
> +        ui.warn(_('warning: merge will create an unstable commit\n'))
>      try:
>          # ui.forcemerge is an internal variable, do not document
>          repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'merge')
> diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
> --- a/tests/test-obsolete.t
> +++ b/tests/test-obsolete.t
> @@ -408,6 +408,12 @@
>    1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
>    5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
>
> +  $ cd clone-dest
> +  $ hg merge --hidden 5
> +  warning: merge will create an unstable commit
> +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  (branch merge, don't forget to commit)
> +  $ cd ..
>
>  Destination repo have existing data
>  ---------------------------------------
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list