[PATCH 6 of 6 mergedriver] localrepo.commit: disallow commit when driver-resolved files exist
Siddharth Agarwal
sid at less-broken.com
Thu Oct 15 03:44:40 CDT 2015
On 10/14/15 16:52, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1444863883 25200
> # Wed Oct 14 16:04:43 2015 -0700
> # Node ID 3328de735f306b8057e0b9ede6b518959cd7dfdc
> # Parent 9f41136f7fa1528e16445da843b63945fbe27857
> localrepo.commit: disallow commit when driver-resolved files exist
A slightly fixed version of these patches + a followup set of 14 more
are available via
hg pull http://42.netv6.net/sid0-wip/hg/ -r 0d4a0d43fcc2
None of these patches change any user-visible behavior -- they're all
hidden behind experimental config options and flags.
There's also a part of the overall feature that I'm not targeting for
this release -- the actual implementation of the merge driver itself.
The idea is to leave stubs in and then implement the merge driver
functionality as a separate extension for now.
If you're curious, an initial version of the extension lives at
https://bitbucket.org/facebook/hg-experimental/src/7baef54cd36da00fa17bf9e1346f9105015cfda0/mergedriver.py?at=default
- Siddharth
>
> This code will not currently be activated because there's no code to mark
> files as driver-resolved in core. This point is also somewhat hard to plug into
> from extensions.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -1553,11 +1553,21 @@ class localrepository(object):
> if merge and cctx.deleted():
> raise error.Abort(_("cannot commit merge with missing files"))
>
> + unresolved, driverresolved = False, False
> ms = mergemod.mergestate(self)
> for f in status.modified:
> - if f in ms and ms[f] == 'u':
> - raise error.Abort(_('unresolved merge conflicts '
> - '(see "hg help resolve")'))
> + if f in ms:
> + if ms[f] == 'u':
> + unresolved = True
> + elif ms[f] == 'd':
> + driverresolved = True
> +
> + if unresolved:
> + raise error.Abort(_('unresolved merge conflicts '
> + '(see "hg help resolve")'))
> + if driverresolved:
> + raise error.Abort(_('driver-resolved merge conflicts'),
> + hint=_('(run "hg resolve --all" to resolve)'))
>
> if editor:
> cctx._text = editor(self, cctx, subs)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list