Commit Graph

26911 Commits

Author SHA1 Message Date
Siddharth Agarwal
6775160009 filemerge: in ':prompt', use ':fail' tool rather than returning directly
The ':fail' tool now knows to write out the changed side for change/delete
conflicts.

This has no impact right now but will make things better when we move
change/delete conflicts in here.
2015-11-24 10:58:35 -08:00
Siddharth Agarwal
1fc099f7ba filemerge: in ':fail' tool, write out other side if local side is deleted
We do this because we don't want to modify the dirstate for failures, and don't
just want to leave the file missing from disk. Plus it's more useful for the
user if the changed side is written out -- it is easier to delete a file than
to get it back via hg revert.
2015-11-24 10:57:01 -08:00
Siddharth Agarwal
c40efd7aa0 mergestate: explicitly forget 'dc' conflicts where the deleted side is picked
Once we move change/delete conflicts into the resolve phase, a 'dc' file might
first be resolved by picking the other side, then later be resolved by picking
the local side. For this transition we want to make sure that the file goes
back to not being in the dirstate.

This has no impact on conflicts during the initial merge.
2015-11-23 18:03:25 -08:00
Siddharth Agarwal
c655a316e8 merge.applyupdates: add all actions returned from merge state
At the moment this is a no-op (the only actions defined are 'r', 'a' and 'g'),
but soon we're going to add other sorts of actions to the dictionary returned
from mergestate.actions().
2015-11-23 19:06:15 -08:00
Mathias De Maré
b4c9b11d12 identify: refer to log to be able to view full hashes 2015-11-27 20:23:23 +01:00
Mathias De Maré
2bc22a2b60 log: add 'hg log' example for full hashes 2015-11-27 20:23:02 +01:00
Mathias De Maré
f15b803069 backout: add examples to clarify basic usage 2015-10-02 07:48:23 +02:00
timeless
0ab681f781 gpg: rename sigcheck function
I see no reason for the function not to be sigcheck ...
2015-11-25 06:10:54 +00:00
Augie Fackler
dafe189e47 extensions: properly mark progress as part of core
This should have been done as part of or as an immediate follow-up to
01b01d59e33f, but presumably this feature of extensions.py was
forgotten at that time.
2015-11-24 18:40:16 -05:00
Yuya Nishihara
c0b0cd8366 test-help: don't use progress extension for the test of argument parsing
The next patch will remove the progress extension completely, so we have
to pick another extension. The schemes is picked arbitrary.

This test was introduced at 57703c45ed60.
2015-11-27 23:10:48 +09:00
timeless
9b03525e5c hghave.py: fix matchoutput documentation 2015-11-24 22:31:56 +00:00
Gregory Szorc
f29561137a dispatch: use versiontuple()
We have a new generic function for this. Use it.
2015-11-24 14:23:46 -08:00
Gregory Szorc
11a7cac430 util: add versiontuple() for returning parsed version information
We have similar code in dispatch.py. Another consumer is about to be
created, so establish a generic function in an accessible location.
2015-11-24 14:23:51 -08:00
Bryan O'Sullivan
94365b400e extensions: rename _ignore to _builtin, add descriptive comment
It was previously not at all obvious what this was for.

We also change it to a set to avoid iterating over an admittedly
small list repeatedly at startup time.
2015-11-24 16:38:54 -08:00
Gregory Szorc
d84af347c4 ui: avoid needless casting to a str
In many cases, we don't need to cast to a str because the object will
be cast when it is eventually written.

As part of testing this, I added some code to raise exceptions when a
non-str was passed in and wasn't able to trigger it. i.e. we're already
passing str into this function everywhere, so the casting isn't
necessary.
2015-11-22 14:44:55 -08:00
Gregory Szorc
b184853d7f ui: remove labeled argument from popbuffer
It was moved to pushbuffer and currently does nothing.
2015-11-24 11:23:10 -08:00
Gregory Szorc
d3425fdff9 color: evaluate labels at write time
Previously, we stored 2-tuples of text and label in a list and then
evaluated the labels when the buffer was popped. After this patch,
we evaluate the labels at write time and do a simple join when the
buffer is popped.

This patch appears to have no impact on performance, despite creating
fewer 2-tuples and having fewer strings hanging around in memory.
2015-11-22 14:18:42 -08:00
Gregory Szorc
9a0cab7d0b cmdutil: pass labeled=True to pushbuffer()
This doesn't yet change behavior because labeling is still performed
at popbuffer time.

Surprisingly, this is the only in-tree consumer that passes
labeled=True.
2015-11-22 14:13:25 -08:00
Gregory Szorc
b338644768 ui: track label expansion when creating buffers
As part of profiling `hg log` performance, I noticed a lot of time
is spent in buffered writes to ui instances. This patch starts a series
that refactors buffered writes with the eventual intent to improve
performance.

Currently, labels are expanded when buffers are popped. This means
we have to preserve the original text and the label until we render
the final output. This is avoidable overhead and adds complexity
since we're retaining state.

This patch adds functionality to ui.pushbuffer() to declare whether
label expansion should be active for the buffer. Labels are still
evaluated during buffer pop. This will change in a subsequent
patch.

Since we'll need to access the "expand labels" flag on future write()
operations, we prematurely optimize how the current value is stored
to optimize for rapid retrieval.
2015-11-22 14:10:48 -08:00
timeless
dd810884fd test-contrib-perf: add smoke tests for perf.py 2015-11-24 21:41:12 +00:00
timeless
6706ae14fe contrib/perf: perfparents handle filtered repos 2015-11-24 21:36:20 +00:00
timeless
0706103b1f contrib/perf: perfparents handle tiny repos
refuse to run if there are not enough commits
2015-11-24 20:54:14 +00:00
timeless
d5fb95573c contrib/perf: fix perfmergecalculate
merge.calculateupdates requires an array of ancestors and followcopies
2015-11-24 21:44:16 +00:00
timeless
1781386673 contrib/perf: fix perffncachewrite
fncache.write requires a transaction (and thus a lock)
2015-11-24 22:01:11 +00:00
timeless
73fa098081 contrib/perf: omit duplicated function 2015-11-24 20:05:15 +00:00
timeless
87b00f7ab0 contrib/perf: name functions to match decorators 2015-11-24 20:08:21 +00:00
timeless
90609ddfb2 hghave.py: remove execute bit 2015-11-24 22:26:43 +00:00
Pierre-Yves David
5dc648f5ae format: create new repository as 'generaldelta' by default
Since we have pushed back the performance issue related to general delta behind
another configuration (Still off by default), we can safely create new
repository with general delta support. As client are compatible with it since
Mercurial 1.9 (4.5 years ago) I do no expect any significant compatibility
issues.
2015-11-02 17:33:18 +00:00
Siddharth Agarwal
51f583c35b shelve: use colon instead of quotes in 'changes to' description
If detailed conflict markers are enabled and the closing quote gets truncated,
editors will often screw syntax highlighting up from that point because they'll
see an opening quote and think it's the beginning of a string.

In tests, the hashes change because the commit messages of the shelved bundles
also change.
2015-11-22 21:40:23 -08:00
Siddharth Agarwal
06ed2cbe50 merge.applyupdates: create absentfilectxes for change/delete conflicts
At the moment no change/delete conflicts get to this point -- we're going to
make that happen in an upcoming patch.
2015-11-22 21:58:28 -08:00
Siddharth Agarwal
5b40330cf9 mergestate: add methods to queue files to remove, add or get
These are meant for use by custom merge drivers that might want to modify the
dirstate. Dirstate internal consistency rules require that all removes happen
before any adds -- this means that custom merge drivers shouldn't be modifying
the dirstate directly.
2015-11-22 21:59:52 -08:00
Siddharth Agarwal
2071a98a25 resolve: record dirstate actions after performing resolutions
Some resolutions might lead to pending actions we need to perform in the
dirstate -- so perform them.
2015-11-15 21:27:22 -08:00
Siddharth Agarwal
be9444426c mergestate: add a way to record pending dirstate actions
We're going to use this in resolve in the next patch.
2015-11-20 16:55:01 -08:00
Siddharth Agarwal
76ecd9e872 merge.recordupdates: don't require action keys to be present in dict
We're going to use this function for a much smaller set of actions in the next
patch. It's easier to do this than to backfill the dict we pass in.
2015-11-15 21:55:46 -08:00
Augie Fackler
18e5d950ee histedit: constant-ify the constraints list
Used a class as a namespace, and then wired up a classmethod to return
all known constraints. I'm mostly happy with this, even though it's
kind of weird for hg.
2015-11-23 10:13:05 -05:00
Mateusz Kwapich
60093bd539 histedit: add an experimental base action
This is a first (very simple) version of the histedit base action.
It works well in common usecases like rebasing the whole stack and
spliting the stack.

I don't see any obvious edge cases - but probably there is more than one.
That's why I want to keep it behind experimental.histeditng config knob
for now. I think on knob for all new histedit behaviors is better because
we will test all of them together and testers will need to turn it on only
once to get all new nice things.
2015-11-17 15:04:31 -08:00
Mateusz Kwapich
0e2838b3e0 histedit: add abortdirty function
Small helper function for aborting histedit when left with dirty working
directory.
2015-11-17 17:53:52 -08:00
Mateusz Kwapich
0cd6ba356d histedit: add forceother constraint
For the future 'base' action in histedit we need a verification
constraint which will not allow using this action with changes
that are currently edited.
2015-11-12 16:40:33 -08:00
Mateusz Kwapich
45af8348f7 histedit: make verification configurable
Before we can add a 'base' action to histedit need to change verification
so that action can specify which steps of verification should run for it.

Also it's everything we need for the exec and stop actions implementation.

I thought about baking verification into each histedit action (so each
of them is responsible for verifying its constraints) but it felt wrong
because:
 - every action would need to know its context (eg. the list of all other
   actions)
 - a lot of duplicated work will be added - each action will iterate through
   all others
 - the steps of the verification would need to be extracted and named anyway
   in order to be reused

The verifyrules function grows too big now. I plan to refator it in one of
the next series.
2015-11-17 16:37:26 -08:00
Anton Shestakov
5c74a8a582 paper: show current revision on file log page
Most of the pages in paper (and coal) style show the current revision and its
branch, tags and bookmarks. Let's also show all this on file log page.
2015-11-13 18:31:58 +08:00
Siddharth Agarwal
d2620ef53f merge.applyupdates: extend action queues with ones returned from mergestate
These queues will always be empty at the moment -- we're going to fill them up
in upcoming patches.
2015-11-20 11:26:31 -08:00
Siddharth Agarwal
1e4024e0f1 mergestate: add a method to compute actions to perform on dirstate
We're going to use this to extend the action lists in merge.applyupdates.

The somewhat funky return value is to make passing this dict directly into
recordactions easier. We're going to exploit that in an upcoming patch.
2015-11-20 16:43:25 -08:00
Siddharth Agarwal
b86e19fd45 merge.applyupdates: use counters from mergestate
This eliminates a whole bunch of duplicate code and allows us to update the
removed count for change/delete conflicts where the delete action was chosen.
2015-11-20 16:37:39 -08:00
Siddharth Agarwal
f919bd4f7b mergestate: add a function to return the number of unresolved files
Note that unlike the other functions, this is based on the persistent
mergestate.
2015-11-20 16:18:51 -08:00
Siddharth Agarwal
8dd9d0304c mergestate: add a method to return updated/merged/removed counts
This will not only allow us to remove a bunch of duplicate code in applyupdates
in an upcoming patch, it will also allow the resolve interface to be a lot
simpler: it doesn't need to return the dirstate action to applyupdates.
2015-11-20 16:17:54 -08:00
Siddharth Agarwal
dd58f25087 mergestate._resolve: don't return the action any more
This is a partial backout of an earlier diff -- now that we're storing the
results in a dict, we don't actually need this any more.
2015-11-20 16:32:47 -08:00
Siddharth Agarwal
aaac3ed514 mergestate._resolve: store return code and action for each file
We're going to need this to compute (a) updated/merged/unresolved counts, and
(b) actions to perform on the dirstate.
2015-11-20 16:08:22 -08:00
Gregory Szorc
8577d931d0 revsetbenchmarks: support benchmarking changectx loading
Many revset consumers construct changectx instances for each returned
result. Add support for benchmarking this to our revset benchmark
script.

In the future, we might want to have some kind of special syntax in
the parsed revset files to engage this mode automatically. This would
enable us to load changectxs for revsets that do that in the code and
would more accurately benchmark what's actually happening. For now,
running all revsets with or without changectxs is sufficient.
2015-11-21 15:43:04 -08:00
Gregory Szorc
86b206e002 perf: support obtaining contexts from perfrevset
Previously, perfrevset called repo.revs(), which only returns integer
revisions. Many revset consumers call repo.set(), which returns
changectx instances. Or they obtain a context manually later.

Since obtaining changectx instances when evaluating revsets is common,
this patch adds support for benchmarking this use case.

While we added an if conditional for every benchmark loop, it
doesn't appear to matter since revset evaluation dwarfs the cost
of a single if.
2015-11-21 15:39:18 -08:00
Gregory Szorc
b8f3c3b570 localrepo: improve docstring for revset methods
revs() doesn't return a list. Also document what its arguments do.

Also clarify that set() is just a convenience wrapper around revs().
2015-11-21 11:07:30 -08:00