Commit Graph

26450 Commits

Author SHA1 Message Date
Matt Mackall
d893847a13 mq: use cmdutil.revert instead of hg.revert
It's the last user.
2015-10-12 03:37:09 -05:00
Siddharth Agarwal
3243c35897 debugmergestate: add support for printing out driver-resolved files 2015-09-30 21:48:53 -07:00
Siddharth Agarwal
f3298676a7 debugmergestate: add support for printing out merge driver 2015-09-30 21:47:27 -07:00
Siddharth Agarwal
3b737ce486 merge.mergedriver: don't try resolving files marked driver-resolved
The driver is expected to take care of these.
2015-09-30 19:43:51 -07:00
Siddharth Agarwal
7cd68f9b50 merge.mergestate: add support for persisting driver-resolved files
A driver-resolved file is a file that's handled specially by the driver. A
common use case for this state would be autogenerated files, the generation of
which should happen only after all source conflicts are resolved.

This is done with an uppercase letter because older versions of Mercurial will
not know how to treat such files at all.
2015-09-28 18:34:06 -07:00
Siddharth Agarwal
5d14dbc5df merge.mergestate: add support for persisting a custom merge driver
A 'merge driver' is a coordinator for the overall merge process. It will be
able to control:

- tools for individual files, much like the merge-patterns configuration does
  today
- tools that can work across groups of files
- the ordering of file resolution
- resolution of automatically generated files
- adding and removing additional files to and from the dirstate

Since it is a critical part of the merge process, it really is part of the
merge state.

This is a lowercase character (i.e. optional) because ignoring this is fine for
older versions of Mercurial -- however, if there are any files that are
specially treated by the driver, we should abort. That will happen in upcoming
patches.

There is a potential security issue with storing the merge driver in the merge
state. See the inline comments for more details.
2015-09-30 21:42:52 -07:00
Gregory Szorc
c0efcd3e47 exchange: support sorting URLs by client-side preferences
Not all bundles are appropriate for all clients. For example, someone
with a slow Internet connection may want to prefer bz2 bundles over gzip
bundles because they are smaller and don't take as long to transfer.
This is information that a server cannot know on its own. So, we invent
a mechanism for "preferring" server-advertised URLs based on their
attributes.

We could invent a negotiation between client and server where the client
sends its preferences and the sorting/filtering is done server-side.
However, this feels complex. We can avoid complicating the wire protocol
and exposing ourselves to backwards compatible concerns by performing
the sorting locally.

This patch defines a new config option for expressing preferred
attributes in server-advertised bundles.

At Mozilla, we leverage this feature so clients in fast data centers
prefer uncompressed bundles. (We advertise gzip bundles first because
that is a reasonable default.)

I consider this an advanced feature. I'm on the fence as to whether it
should be documented in `hg help config`.
2015-10-13 12:30:39 -07:00
Gregory Szorc
9516d6763b exchange: extract bundle specification components into own attributes
An upcoming patch will enable clients to prefer certain bundles over
others. The idea is that we define values of attributes from manifests
that are desirable.

The BUNDLESPEC attribute is a complex value consisting of multiple
parts. Clients may wish to only prefer one of these parts. Having to
specify every combination of BUNDLESPEC would be annoying. So, we
extract the components of BUNDLESPEC into their own attributes so
clients can easily filter on a sub-component.
2015-10-13 12:31:19 -07:00
Gregory Szorc
3b0f2a4363 exchange: support preserving external names when parsing bundle specs
This will be needed to make client-side preferences work easier.
2015-10-13 12:29:50 -07:00
Gregory Szorc
7f6305218b clonebundles: filter on SNI requirement
Server Name Indication (SNI) is commonly used in CDNs and other hosted
environments. Unfortunately, Python <2.7.9 does not support SNI and when
these older Python versions attempt to negotiate TLS to an SNI server,
they raise an opaque error like
"_ssl.c:507: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert
handshake failure."

We introduce a manifest attribute to denote the URL requires SNI and
have clients without SNI support filter these entries.
2015-10-13 10:59:41 -07:00
Gregory Szorc
11b70bd7bb clonebundles: filter on bundle specification
Not all clients are capable of reading every bundle. Currently, content
negotiation to ensure a server sends a client a compatible bundle
format is performed at request time. The response bundle is dynamically
generated at request time, so this works fine.

Clone bundles are statically generated *before* the request. This means
that a modern server could produce bundles that a legacy client isn't
capable of reading. Without some kind of "type hint" in the clone
bundles manifest, a client may attempt to download an incompatible
bundle. Furthermore, a client may not realize a bundle is incompatible
until it has processed part of the bundle (imagine consuming a 1 GB
changegroup bundle2 part only to discover the bundle2 part afterwards is
incompatibl). This would waste time and resources. And it isn't very
user friendly.

Clone bundle manifests thus need to advertise the *exact* format of the
hosted bundles so clients may filter out entries that they don't know
how to read. This patch introduces that mechanism.

We introduce the BUNDLESPEC attribute to declare the "bundle
specification" of the entry. Bundle specifications are parsed using
exchange.parsebundlespecification, which uses the same strings as the
"--type" argument to `hg bundle`. The supported bundle specifications
are well defined and backwards compatible.

When a client encounters a BUNDLESPEC that is invalid or unsupported, it
silently ignores the entry.
2015-10-13 11:45:30 -07:00
Gregory Szorc
cf1dfbfb60 clonebundle: support bundle2
exchange.readbundle() can return 2 different types. We weren't handling
the bundle2 case. Handle it.

At some point we'll likely want a generic API for applying a bundle from
a file handle. For now, create another one-off until we figure out what
the unified bundle API should look like (addressing this is a can of
worms I don't want to open right now).
2015-10-13 10:41:54 -07:00
Pierre-Yves David
4d0a009765 update: also use 'destupdate' for pull and unbundle
Update can also be performed by 'hg pull --update' and 'hg unbundle'. We use the
destupdate function in these case too.
2015-10-05 21:31:32 -07:00
Pierre-Yves David
d22b16ba8c destupdate: also include bookmark related logic
For the same reason, we move the bookmark related update logic into the
'destupdate' function. This requires to extend the returns of the function to
include the bookmark that needs to move (more or less) and the bookmark to
activate at the end of the function. See function documentation for details on
this returns.
2015-09-29 01:03:26 -07:00
Gregory Szorc
c55df1f741 exchange: refactor bundle specification parsing
The old code was tailored to `hg bundle` usage and not appropriate for
use as a general API, which clone bundles will require. The code has
been rewritten to make it more generally suitable.

We introduce dedicated error types to represent invalid and unsupported
bundle specifications. The reason we need dedicated error types (rather
than error.Abort) is because clone bundles will want to catch these
exception as part of filtering entries. We don't want to swallow
error.Abort on principle.
2015-10-13 10:57:54 -07:00
Gregory Szorc
5e2a52d9ca exchange: move bundle specification parsing from cmdutil
Clone bundles require a well-defined string to specify the type of
bundle that is listed so clients can filter compatible file types. The
`hg bundle` command and cmdutil.parsebundletype() already establish the
beginnings of a bundle specification format.

As part of formalizing this format specification so it can be used by
clone bundles, we move the specification parsing bits verbatim to
exchange.py, which is a more suitable place than cmdutil.py. A
subsequent patch will refactor this code to make it more appropriate as
a general API.
2015-10-13 11:43:21 -07:00
Yuya Nishihara
c7bc2fcfb9 revset: add optional offset argument to limit() predicate
It's common for GUI or web frontend to fetch chunk of revisions per batch
size. Previously it was possible only if revisions were sorted by revision
number.

  $ hg log -r 'limit({revspec} & :{last_known}, 101)'

So this patch introduces a general way to retrieve chunk of revisions after
skipping offset revisions.

  $ hg log -r 'limit({revspec}, 100, {last_count})'

This is a dumb implementation. We can optimize it for baseset and spanset
later.
2015-03-24 00:28:28 +09:00
Yuya Nishihara
772342e4a1 revset: port limit() to support keyword arguments
The next patch will introduce the third 'offset' argument. This allows us
to specify 'offset' without 'n' argument.
2015-10-12 17:19:22 +09:00
Yuya Nishihara
516c2f1e3b revset: eliminate temporary reference to subset in limit() and last() 2015-10-12 17:14:47 +09:00
FUJIWARA Katsunori
5e2a0f5090 dirstate: read from pending file under HG_PENDING mode if it exists
True/False value of '_pendingmode' means whether 'dirstate.pending' is
used to initialize own '_map' and so on. When it is None, neither
'dirstate' nor 'dirstate.pending' is read in yet.

This is used to keep consistent view between '_pl()' and '_read()'.

Once '_pendingmode' is determined by reading one of 'dirstate' or
'dirstate.pending' in, '_pendingmode' is kept even if 'invalidate()'
is invoked. This should be reasonable, because:

  - effective 'invalidate()' invocation should occur only in wlock scope, and
  - wlock can't be gotten under HG_PENDING mode

'_trypending()' is defined as a normal function to factor similar code
path (in bookmarks and phases) out in the future easily.
2015-10-14 02:49:17 +09:00
FUJIWARA Katsunori
2ef2ab5d6d dirstate: make writing in-memory changes aware of transaction activity
This patch delays writing in-memory changes out, if transaction is
running.

'_getfsnow()' is defined as a function, to hook it easily for
ambiguous timestamp tests (see also fakedirstatewritetime.py)

'if tr:' code path in this patch is still disabled at this revision,
because there is no client invoking 'dirstate.write()' with repo
object.

BTW, this patch changes 'dirstate.invalidate()' semantics around
'dirstate.write()' in a transaction scope:

  before:
    with repo.transaction():
        dirstate.CHANGE('A')
        dirstate.write() # change for A is written out here
        dirstate.CHANGE('B')
        dirstate.invalidate() # discards only change for B

  after:
    with repo.transaction():
        dirstate.CHANGE('A')
        dirstate.write() # change for A is still kept in memory
        dirstate.CHANGE('B')
        dirstate.invalidate() # discards changes for A and B

Fortunately, there is no code path expecting the former, at least, in
Mercurial itself, because 'dirstateguard' was introduced to remove
such 'dirstate.invalidate()'.
2015-10-14 02:49:17 +09:00
FUJIWARA Katsunori
bde9721b18 dirstate: make functions for backup aware of transaction activity
Some comments in this patch assume that subsequent patch changes
'dirstate.write()' like as below:

    def write(self, repo):
        if not self._dirty:
            return
        tr = repo.currenttransaction()
        if tr:
            tr.addfilegenerator('dirstate', (self._filename,),
                                self._writedirstate, location='plain')
            return # omit actual writing out
        st = self._opener('dirstate', "w", atomictemp=True)
        self._writedirstate(st)

This patch makes '_savebackup()' write in-memory changes out, and it
causes clearing 'self._dirty'. If dirstate isn't changed after
'_savebackup()', subsequent 'dirstate.write()' never invokes
'tr.addfilegenerator()' because 'not self._dirty' is true.

Then, 'tr.writepending()' unintentionally returns False, if there is
no other (e.g. changelog) changes pending, even though dirstate
changes are already written out at '_savebackup()'.

To avoid such situation, this patch makes '_savebackup()' explicitly
invoke 'tr.addfilegenerator()', if transaction is running.

'_savebackup()' should get awareness of transaction before 'write()',
because the former depends on the behavior of the latter before this
patch.
2015-10-14 02:49:17 +09:00
FUJIWARA Katsunori
af664f3cc0 dirstate: move code paths for backup from dirstateguard to dirstate
This can centralize the logic to write in-memory changes out correctly
according to transaction activity into dirstate.

Passing 'repo' object to newly added functions is needed to examine
current transaction activity in subsequent patches, because 'dirstate'
itself doesn't have direct reference to it.
2015-10-14 02:49:17 +09:00
FUJIWARA Katsunori
344e42ce00 localrepo: restore dirstate to one before rollbacking if not parent-gone
'localrepository.rollback()' explicilty restores dirstate, only if at
least one of current parents of the working directory is removed at
rollbacking (a.k.a "parent-gone").

After DirstateTransactionPlan, 'dirstate.write()' will cause marking
'.hg/dirstate' as a file to be restored at rollbacking.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

Then, 'transaction.rollback()' restores '.hg/dirstate' regardless of
parents of the working directory at that time, and this causes
unexpected dirstate changes if not "parent-gone" (e.g.  "hg update" to
another branch after "hg commit" or so, then "hg rollback").

To avoid such situation, this patch restores dirstate to one before
rollbacking if not "parent-gone".

  before:
    b1. restore dirstate explicitly, if "parent-gone"

  after:
    a1. save dirstate before actual rollbacking via dirstateguard
    a2. restore dirstate via 'transaction.rollback()'
    a3. if "parent-gone"
        - discard backup (a1)
        - restore dirstate from 'undo.dirstate'
    a4. otherwise, restore dirstate from backup (a1)

Even though restoring dirstate at (a3) after (a2) seems redundant,
this patch keeps this existing code path, because:

  - it isn't ensured that 'dirstate.write()' was invoked at least once
    while transaction running

    If not, '.hg/dirstate' isn't restored at (a2).

    In addition to it, rude 3rd party extension invoking
    'dirstate.write()' without 'repo' while transaction running (see
    subsequent patches for detail) may break consistency of a file
    backup-ed by transaction.

  - this patch mainly focuses on changes for DirstateTransactionPlan

    Restoring dirstate at (a3) itself should be cheaper enough than
    rollbacking itself. Redundancy will be removed in next step.

Newly added test is almost meaningless at this point. It will be used
to detect regression while implementing delayed dirstate write out.
2015-10-13 12:25:43 -07:00
FUJIWARA Katsunori
77975f1ce1 parsers: make pack_dirstate take now in integer for consistency
On recent OS, 'stat.st_mtime' has a double precision floating point
value to represent nano seconds, but it is not wide enough for actual
file timestamp: nowadays, only 52 - 32 = 20 bit width is available for
decimal places in sec.

Therefore, casting it to 'int' may cause unexpected result. See also
changeset 8102a3981272 fixing issue4836 for detail.

For example, changed file A may be treated as "clean" unexpectedly in
steps below. "rounded now" is the value gotten by rounding via
'int(st.st_mtime)' or so.

    ---------------------+--------------------+------------------------
    "now"                |                    | timestamp of A (time_t)
    float  rounded time_t| action             | FS       dirstate
    ------ ------- ------+--------------------+-------- ---------------
    N+.nnn   N       N   |                    | ---      ---
                         | update file A      |  N
                         | dirstate.normal(A) |           N
    N+.999   N+1     N   |                    |
                         | dirstate.write()   |           N (*1)
                         |    :               |
                         | change file A      |  N
                         |    :               |
    N+1.00   N+1    N+1  |                    |
                         | "hg status" (*2)   |  N        N
    ------ ------- ------+--------------------+-------- ---------------

Timestamp N of A in dirstate isn't dropped at (*1), because "rounded
now" is N+1 at that time, even if 'st_mtime' in 'time_t' is still N.

Then, file A is unexpectedly treated as "clean" at (*2) in this case.

For consistent handling of 'stat.st_mtime', this patch makes
'pack_dirstate()' take 'now' argument not in floating point but in
integer.

This patch makes 'PyArg_ParseTuple()' in 'pack_dirstate()' use format
'i' (= checking type mismatch or overflow), even though it is ensured
that 'now' is in the range of 32bit signed integer by masking with
'_rangemask' (= 0x7fffffff) on caller side.

It should be cheaper enough than packing itself, and useful to
detect that legacy code invokes 'pack_dirstate()' with 'now' in
floating point value.
2015-10-14 02:40:04 +09:00
Pierre-Yves David
1850d9f649 destupdate: include the 'check' logic
After moving logic from 'merge.update' into 'destutil.destupdate', we are now
moving logic from 'command.update' in 'destutil.destupdate'. This will make the
function actually useful in predicting (and altering) the update behavior.
2015-09-29 00:18:49 -07:00
Pierre-Yves David
1f1a2ae237 destupdate: move the check related to the "clean" logic in the function
We want this function to exactly predict the behavior for update. Moreover, we
would like to remove all high level behavior logic out of the merge module so
this is a step forward.

Now that the 'destupdate' function both compute and validate the destination, we
can directly use it at the command level, ensuring that the 'hg update' command
never call 'merge.update' without a defined destination. This is a first (but
significant) step toward having 'merge.update' always feed with a properly
validated destination and free of high level logic.
2015-10-05 03:50:47 -07:00
Mads Kiilerich
2de7a8b7cf largefiles: better handling of merge of largefiles that not are available
Before, when merging revisions with missing largefiles, the missing largefiles
would be fetched as a part of the merge. If that failed (for example because
the main repository temporarily was unavailable), the largefile would be left
missing. However, the next commit would abort and (seemed to) fail when
markcommitted tried to mark the standin file as normal and thus had to hash the
largefile that didn't exist. (Actually, the commit would succeed but the
largefile update that follows right after the commit transaction would abort -
quite confusing.)

To fix that, make sure that synclfdirstate only marks files as normal if they
actually exist.
2015-10-12 19:22:34 +02:00
Pierre-Yves David
53ed633b94 patchbomb: check that targets exist at the publicurl
Advertising that the patch are available to be pulled requires that to be true.
So we check revision availability on the remote before sending any email.
2015-10-11 22:13:03 -07:00
Mads Kiilerich
3772833300 windows: read all global config files, not just the first (issue4491) (BC)
On windows, hgrc.d/*.rc would not be read if mercurial.ini was found. That was
far from obvious from the documentation and different from the behavior on
posix systems.

As a consequence of this, TortoiseHg cacert configuration placed in hgrc.d
would not be read if an old global mercurial.ini still existed.

"hg config -g" could also crash when no global configuration files could be
found.

Instead, make windows behave like posix and read all global configuration
files.

The documentation was in a way right that individual config settings in the
global Mercurial.ini would override settings from for example .hgrc.d\*.rc, but
only because the .d files not would be read at all if a Mercurial.ini was
found. The ordering in the documentation is thus changed to match the code.
2015-10-12 20:13:12 +02:00
Ryan McElroy
61f504197f strip: factor out revset calculation for strip -B
This will allow reusing it in evolve and overriding it in other extensions.
2015-10-09 14:48:59 -07:00
Gregory Szorc
5d1b4c49ee clonebundles: support for seeding clones from pre-generated bundles
Cloning can be an expensive operation for servers because the server
generates a bundle from existing repository data at request time. For
a large repository like mozilla-central, this consumes 4+ minutes
of CPU time on the server. It also results in significant network
utilization. Multiplied by hundreds or even thousands of clients and
the ensuing load can result in difficulties scaling the Mercurial server.

Despite generation of bundles being deterministic until the next
changeset is added, the generation of bundles to service a clone request
is not cached. Each clone thus performs redundant work. This is
wasteful.

This patch introduces the "clonebundles" extension and related
client-side functionality to help alleviate this deficiency. The
client-side feature is behind an experimental flag and is not enabled by
default.

It works as follows:

1) Server operator generates a bundle and makes it available on a
   server (likely HTTP).
2) Server operator defines the URL of a bundle file in a
   .hg/clonebundles.manifest file.
3) Client `hg clone`ing sees the server is advertising bundle URLs.
4) Client fetches and applies the advertised bundle.
5) Client performs equivalent of `hg pull` to fetch changes made since
   the bundle was created.

Essentially, the server performs the expensive work of generating a
bundle once and all subsequent clones fetch a static file from
somewhere. Scaling static file serving is a much more manageable
problem than scaling a Python application like Mercurial. Assuming your
repository grows less than 1% per day, the end result is 99+% of CPU
and network load from clones is eliminated, allowing Mercurial servers
to scale more easily. Serving static files also means data can be
transferred to clients as fast as they can consume it, rather than as
fast as servers can generate it. This makes clones faster.

Mozilla has implemented similar functionality of this patch on
hg.mozilla.org using a custom extension. We are hosting bundle files in
Amazon S3 and CloudFront (a CDN) and have successfully offloaded
>1 TB/day in data transfer from hg.mozilla.org, freeing up significant
bandwidth and CPU resources. The positive impact has been stellar and
I believe it has proved its value to be included in Mercurial core. I
feel it is important for the client-side support to be enabled in core
by default because it means that clients will get faster, more reliable
clones and will enable server operators to reduce load without
requiring any client-side configuration changes (assuming clients are
up to date, of course).

The scope of this feature is narrowly and specifically tailored to
cloning, despite "serve pulls from pre-generated bundles" being a valid
and useful feature. I would eventually like for Mercurial servers to
support transferring *all* repository data via statically hosted files.
You could imagine a server that siphons all pushed data to bundle files
and instructs clients to apply a stream of bundles to reconstruct all
repository data. This feature, while useful and powerful, is
significantly more work to implement because it requires the server
component have awareness of discovery and a mapping of which changesets
are in which files. Full, clone bundles, by contrast, are much simpler.

The wire protocol command is named "clonebundles" instead of something
more generic like "staticbundles" to leave the door open for a new, more
powerful and more generic server-side component with minimal backwards
compatibility implications. The name "bundleclone" is used by Mozilla's
extension and would cause problems since there are subtle differences
in Mozilla's extension.

Mozilla's experience with this idea has taught us that some form of
"content negotiation" is required. Not all clients will support all
bundle formats or even URLs (advanced TLS requirements, etc). To ensure
the highest uptake possible, a server needs to advertise multiple
versions of bundles and clients need to be able to choose the most
appropriate from that list one. The "attributes" in each
server-advertised entry facilitate this filtering and sorting. Their
use will become apparent in subsequent patches.

Initial inspiration and credit for the idea of cloning from static files
belongs to Augie Fackler and his "lookaside clone" extension proof of
concept.
2015-10-09 11:22:01 -07:00
Gregory Szorc
6cc7d3daaa sslutil: expose attribute indicating whether SNI is supported
This will be used so clone bundles can advertise whether URLs require
SNI. This will be explained more in a subsequent patch.
2015-09-29 16:17:32 -07:00
Siddharth Agarwal
25aa934095 resolve: perform all premerges before performing any file merges (BC)
Just like the BC to merge before it, this allows for a maximally consistent
state before providing any prompts to the user.
2015-10-11 23:58:07 -07:00
Siddharth Agarwal
4961e30679 test-resolve.t: add some tests for .orig file contents
An upcoming patch will touch some code around this area, and I couldn't find
any tests related to this.
2015-10-11 23:56:44 -07:00
Siddharth Agarwal
b47d5aac3c test-resolve.t: add some output to show order of operations
This basically shows the behavior of resolve with multiple files. An upcoming
behavior change will cause this output to also change.
2015-10-11 23:54:40 -07:00
Siddharth Agarwal
c97c4cf7f6 merge.mergestate: perform all premerges before any merges (BC)
We perform all that we can non-interactively before prompting the user for input
via their merge tool. This allows for a maximally consistent state when the user
is first prompted.

The test output changes indicate the actual behavior change happening.
2015-10-11 21:56:39 -07:00
Siddharth Agarwal
8b2a429453 merge: introduce a preresolve function
The section of code that writes out the version of the file cached in the merge
state should only be run at preresolve time. This is so that if the premerge
keeps around conflict markers, those don't get overwritten before the main
merge.
2015-10-11 20:12:12 -07:00
Siddharth Agarwal
cbb558b9d7 merge.mergestate._resolve: also return completed status
We'll need this for a new 'preresolve' function we're adding.
2015-10-11 18:37:54 -07:00
Siddharth Agarwal
2826ed841f merge.mergestate: add a wrapper around resolve
The resolve function will be broken up into separate pre-resolve and resolve
steps.
2015-10-11 18:29:50 -07:00
Siddharth Agarwal
a6dc53e738 simplemerge: move conflict warning message to filemerge
The current output for a failed merge with conflict markers looks something like:

  merging foo
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  merging bar
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

We're going to change the way merges are done to perform all premerges before
all merges, so that the output above would look like:

  merging foo
  merging bar
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

The 'warning: conflicts during merge' line has no context, so is pretty
confusing.

This patch will change the future output to:

  merging foo
  merging bar
  warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
  warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')

The hint on how to resolve the conflicts makes this a bit unwieldy, but solving
that is tricky because we already hint that people run 'hg resolve' to retry
unresolved merges. The 'hg resolve --mark' mostly applies to conflict marker
based resolution.
2015-10-09 13:54:52 -07:00
Siddharth Agarwal
dceb171bec filemerge: clean up some dead code
We now exit early if we do a premerge, so extra checks are no longer necessary.
2015-10-11 15:04:00 -07:00
Augie Fackler
f010f2acf9 run-tests: add b-prefix on two strings to fix python3 support 2015-10-12 14:15:04 -04:00
Siddharth Agarwal
88da24240c filemerge: break overall filemerge into separate premerge and merge steps
This means that in ms.resolve we must call merge after calling premerge. This
doesn't yet mean that all premerges happen before any merges -- however, this
does get us closer to our goal.

The output differences are because we recompute the merge tool. The only
user-visible difference caused by this patch is that if the tool is missing
we'll print the warning twice. Not a huge deal, though.
2015-10-11 20:47:14 -07:00
Siddharth Agarwal
b1a86ac060 filemerge: only copy to backup during premerge step
The premerge might leave the original file in an unclean state. Therefore it's
important to only copy the file in the beginning.
2015-10-11 20:04:40 -07:00
Siddharth Agarwal
014002cfa1 filemerge: only print out "merging f" output at premerge step
We're soon going to call this function twice, once for premerge and once for
merge. This makes sure the "merging" output only gets printed during the
premerge step.
2015-10-11 20:02:53 -07:00
Siddharth Agarwal
76bf2a7269 filemerge: deindent the parts of filemerge outside the try block
It is no longer necessary to indent these parts.
2015-10-08 00:19:20 -07:00
Siddharth Agarwal
dd90f817f9 filemerge: introduce a premerge flag and function
This flag will let us get to our overall goal of performing all premerges
before any merges.
2015-10-11 20:47:04 -07:00
Siddharth Agarwal
82f2aec334 filemerge: also return whether the merge is complete
In future patches, we'll pause merges after the premerge step. After the
premerge step we'll return complete = False.
2015-10-11 12:56:21 -07:00
Siddharth Agarwal
da75e232c9 filemerge: add a wrapper around the filemerge function
We'll introduce a separate premerge function that calls the same code.
2015-10-11 12:31:08 -07:00