[PATCH 2 of 2] add --force to commit options

Matt Mackall mpm at selenic.com
Mon Jan 9 19:02:32 CST 2012


On Mon, 2012-01-09 at 14:46 +0100, Johan Euphrosine wrote:
> # HG changeset patch
> # User Johan Euphrosine <proppy at google.com>
> # Date 1326116607 -3600
> # Node ID a08547027b43603f26e71fd03f855fdd8b226a94
> # Parent  afdf4f5bac6147476ef4834707e5bfd687e39202
> add --force to commit options

What's the rationale for this? 

"It allows to do a merge --force and a merge commit if a subrepos is in
a dirty state."

I usually don't not read 0 of X messages, as a matter of both habit and
principle. If it's not in the commit summary, for historical purposes,
it does not exist.

But even when I've found your description, I have no clear idea of what
it means, or why/when it would be a good idea. It certainly seems like a
very bad idea to me.


> diff -r afdf4f5bac61 -r a08547027b43 mercurial/commands.py
> --- a/mercurial/commands.py	Mon Dec 26 15:01:06 2011 +0100
> +++ b/mercurial/commands.py	Mon Jan 09 14:43:27 2012 +0100
> @@ -1154,6 +1154,7 @@
>       _('mark new/missing files as added/removed before committing')),
>      ('', 'close-branch', None,
>       _('mark a branch as closed, hiding it from the branch list')),
> +    ('f', 'force', None, _('force a merge commit with outstanding changes'))

I'm sure it allows lots of bad behavior beyond that.

>      ] + walkopts + commitopts + commitopts2 + subrepoopts,
>      _('[OPTION]... [FILE]...'))
>  def commit(ui, repo, *pats, **opts):
> @@ -1195,7 +1196,7 @@
>  
>      def commitfunc(ui, repo, message, match, opts):
>          return repo.commit(message, opts.get('user'), opts.get('date'), match,
> -                           editor=e, extra=extra)
> +                           editor=e, extra=extra, force=opts.get('force'))
>  
>      branch = repo[None].branch()
>      bheads = repo.branchheads(branch)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list