Commit Graph

26537 Commits

Author SHA1 Message Date
Siddharth Agarwal
7164a1a80a localrepo.commit: disallow commit when driver-resolved files exist
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.
2015-10-14 16:04:43 -07:00
Siddharth Agarwal
e65ca7df8c merge.mergestate: add a generator for driver-resolved files
Just like for unresolved files above, we need to be able to tell what files are
driver-resolved.
2015-10-14 15:01:07 -07:00
Siddharth Agarwal
b27d150373 hook: for python hooks, also return whether an exception was raised
The hook code treats python hooks raising an exception and returning True as
the exact same. This is OK for hooks themselves, but other code that wants to
invoke external code using the same underlying code is a bit more interested in
making a distinction.
2015-10-14 16:27:10 -07:00
Siddharth Agarwal
220ff1aedf hook.runhooks: return a dict of result values
This will be useful to other calling code that would be interested in what the
individual hooks return.
2015-10-14 16:19:47 -07:00
Siddharth Agarwal
4ff268b773 hook: factor out determination of hooks from running them
This will allow other code to run a predetermined series of hooks.
2015-10-14 16:13:31 -07:00
Mads Kiilerich
ccf61891e6 mq: generate patch names from first line of description
Avoid the pointless numeric rev.diff patch names.

Instead, do like mbox extension does and create meaningful patch names.
2015-03-10 13:19:17 +01:00
Mads Kiilerich
1f01797b63 contrib: offer Python 2.7.10 2015-10-15 21:36:47 +02:00
Mads Kiilerich
e2a51cd4a4 contrib: drop Python < 2.6 from Makefile.python 2015-10-15 21:35:49 +02:00
Mads Kiilerich
c53290a7f0 mergetools.rc: find OSX FileMerge in the new location inside Xcode 4.3 2015-10-16 11:37:34 +02:00
Gregory Szorc
8bb79e1017 exchange: don't print error codes after clone bundle failure
We don't appear to print error codes elsewhere. The error codes are
inconsistent between at least Linux and OS X and are more trouble than
they are worth. Humans care about the error string more than the code
anyway.

A glob was also added to pave over differences in error strings between
Linux and OS X.
2015-10-15 14:53:32 -07:00
Augie Fackler
d2b9a17e64 debian: install bash completion as hg and not mercurial (issue4900) 2015-10-14 14:53:15 -04:00
Augie Fackler
32827d85c7 merge-tools: allow marking a mergetool as completely disabled
Very often in my life I'm finding that the only configured merge tool
present on the system is vimdiff[0], and it's currently impossible (as
far as I can tell) short of specifying `ui.merge = `[1] to actually
*disable* a merge tool. This allows vimdiff-haters to put:

  [merge-tools]
  vimdiff.disable = yes

in their ~/.hgrc and never see vimdiff again. I'm stopping short of
putting this as a commented out entry in the sample new user hgrc
(seen when a user runs `hg config --edit` with no ~/.hgrc) for now,
but I might come back and do that later.

0: vimdiff is at an awkward intersection: it's usually installed by
the vim package which is often installed as a vi substitute, so it's
mere presence doesn't imply me wanting it, unlike (say) kdiff3.

1: There's a related problem I ran into today where specifying
`ui.merge = :merge` failed because :merge isn't a command, which I
think is a regression. I'll try and figure that out and at least file
a bug.
2015-10-14 12:57:33 -04:00
Sean Farley
ca3c3b3a56 exchange: add oparg to push so that extensions can wrap pushop 2015-10-13 23:04:53 -07:00
Pierre-Yves David
234c3afb90 destmerge: extract logic based on branch heads in its own function
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 03:15:54 +01:00
Pierre-Yves David
065efbf449 destmerge: extract logic based on bookmark into its own function
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 03:13:14 +01:00
Pierre-Yves David
b6c0464fcc destupdate: have a generic and extensible way to run each step
We want extension to be able to easily override or add new way to select the
default update destination. We use the same list + dict approach as in other
parts of the code.
2015-10-15 03:00:09 +01:00
Pierre-Yves David
6fa23d38a1 destupdate: extract logic based on branch in its own function
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 02:33:09 +01:00
Pierre-Yves David
07af7a7ec4 destupdate: extract logic based on bookmarks in its own function
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 02:27:30 +01:00
Pierre-Yves David
6594fee40e destupdate: extract logic based on obsolescence marker in its own function
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 02:15:43 +01:00
Pierre-Yves David
1331d59a5c destupdate: move obsolete handling first
This block was overwriting any result from the previous block anyway. So we move
it first to prove it is possible and we'll extract it in its own function in the
next patch.
2015-10-15 02:12:55 +01:00
Pierre-Yves David
b9d3d2a9c2 destupdate: indent bookmark and branch logic
We'll move the obsolete related logic first (as it is overwriting any other
anyway) to make the next patch clearer we add indentation in this one.
2015-10-15 02:12:15 +01:00
Pierre-Yves David
1ef8c926f9 destupdate: extract validation logic
One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
2015-10-15 14:10:57 +01:00
Pierre-Yves David
972436d679 rebase: rename and test '_destrebase'
We make the name consistent with the other similar revsets and make sure it has
minimal tests.
2015-10-15 01:56:03 +01:00
Pierre-Yves David
4a4b12d369 rebase: directly use '_destrebase'
There is little value in using the revset instead of the function.
2015-10-15 01:51:53 +01:00
Pierre-Yves David
1ac31ad0a1 rebase: extra default destination in its own function
This makes it much simple to wrap for other extension.
2015-10-15 01:50:31 +01:00
Pierre-Yves David
4664d62d42 revset: rename and test '_destmerge'
We make the name consistent with the one used by '_destupdate' and we ensure the
code is run by testing it (abort is expected and merge would).
2015-10-15 01:47:28 +01:00
Pierre-Yves David
37fca6bc97 merge: directly get destination from destutil
There is no real value in using the revset over the function.

The revset have no remaining users and will be taken care of in a later
changesets.
2015-10-15 01:19:32 +01:00
Pierre-Yves David
614a2e0418 destutil: move default merge destination into a function
Function in destutil are much simpler to wrap and more flexible than revset.
This also help consistency as 'destupdate' live here and cannot become a pure
revset anyway.
2015-10-15 01:11:00 +01:00
Pierre-Yves David
fb61444d77 revset: reintroduce and experimental revset for update destination
The revset is not ready for prime time yet. However it is useful to have some
version of it exposed to help candidate users to play with it and provide
feedback on what we should aim at.

We add a small test to make sure the code runs.
2015-10-15 01:35:44 +01:00
Augie Fackler
96c9d2fb66 changegroup: move manifest unpacking into its own method
The upcoming cg3 will need different logic for unpacking manifests.
2015-10-14 15:11:53 -04:00
Augie Fackler
ebae33811b changegroup: move manifest packing into a separate function
A future change will introduce a new function on a cg3packer that can
pack treemanifests as well as flatmanifests.
2015-10-01 15:35:10 -04:00
Augie Fackler
f3c48144c3 changegroup: rename manifest linknode closure for clarity
Since I'm spending the time to understand this code, I may as well
leave it clearer than I found it.
2015-09-30 19:59:12 -04:00
Augie Fackler
af65966d0c changegroup: reformat packermap and add comment
I'm about to add a cg3, and it seems prudent to annotate what formats
support what features. It strikes me that we may want to consider
moving to a more feature-oriented model in the future, but we'll see
how that looks in a little while I guess.
2015-09-29 15:14:03 -04:00
Augie Fackler
63207d7efe changegroup: document the public surface area of cg?unpackers
This should help future readers at least a little.
2015-10-14 12:05:27 -04:00
Augie Fackler
f83ec87df0 changegroup: mark cg1unpacker.chunklength as private 2015-10-14 11:58:56 -04:00
Augie Fackler
c297597d4b changegroup: note why a few methods on cg1unpacker exist
I'm not sure what to do abstraction-wise here. It might be more
sensible to make a memoryrepo that could apply a bundle in-memory and
then we could make the changegroup data be strictly an applyable
stream, but that's an idea for Later.
2015-10-14 11:58:35 -04:00
Augie Fackler
e212c519f3 revlog: rename bundle to cg to reflect its nature as a cg?unpacker
The new convention is that bundles contain changegroups. bundle1
happens to *only* be a changegroup, but bundle2 is a more featureful
container that isn't something you can pass to addgroup().
2015-10-14 11:32:33 -04:00
Augie Fackler
4978a2ba88 changegroup: mark _addchangegroupfiles as module-private
I'm trying to reason about the public surface area of this module now,
so it's worth tagging private things as such.
2015-10-13 17:16:10 -04:00
Augie Fackler
4933ef34f9 changegroup: delete now-unused addchangegroup method 2015-10-13 17:14:37 -04:00
Augie Fackler
a6bb3f0de9 localrepo: use cg?unpacker.apply() instead of changegroup.addchangegroup()
This is in localpeer, so it lives. Had it been in localrepo instead, I
would have tried to exterminate it.
2015-10-13 17:14:07 -04:00
Augie Fackler
5888f3afd8 repair: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:12:46 -04:00
Augie Fackler
30c5897436 exchange: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:12:29 -04:00
Augie Fackler
6f5eadc443 commands: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:12:12 -04:00
Augie Fackler
b9b5df0ea1 bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:11:52 -04:00
Augie Fackler
cb2b7df9f2 shelve: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:11:18 -04:00
Augie Fackler
f53d137cd7 histedit: use cg?unpacker.apply() instead of changegroup.addchangegroup() 2015-10-13 17:14:21 -04:00
Augie Fackler
7acc1ffbe4 changegroup: migrate addchangegroup() to forward to cg?unpacker.apply()
I'll clean up callers in subsequent patches, then remove the forwarding.
2015-10-13 16:58:51 -04:00
Augie Fackler
24acce6876 changegroup: move source check to top of addchangegroup
This is preparation for some refactoring.
2015-10-13 15:54:05 -04:00
Augie Fackler
6caeb62341 error: remove superfluous pass statements 2015-10-15 09:52:32 -04:00
Siddharth Agarwal
d01bcde561 hook: raise a separate exception for when loading a hook fails
For easier catching.
2015-10-12 18:49:23 -07:00