Commit Graph

26664 Commits

Author SHA1 Message Date
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
Gregory Szorc
15ac94d01f clonebundles: advertise clone bundles feature to clients
Server operators that have enabled clone bundles probably want clients
to use it. This patch introduces a feature that will insert a bundle2
"output" part that advertises the existence of the clone bundles
feature to clients that aren't using it.

The server uses the "cbattempted" argument to "getbundle" to determine
whether a client supports clone bundles and to avoid sending the message
to clients that failed the clone bundle for whatever reason.
2015-10-14 11:05:53 -07:00
Gregory Szorc
9f94bd29c6 exchange: advertise if a clone bundle was attempted
The client now sends a "cbattempted" boolean flag to the "getbundle"
wire protocol command to tell the server whether a clone bundle was
attempted.

The presence of this flag will enable the server to conditionally emit a
bundle2 "output" part advertising the availability of clone bundles to
compatible clients that don't have it enabled.
2015-10-14 10:36:20 -07:00
Gregory Szorc
cd1d42460a exchange: record that we attempted to fetch a clone bundle
This is needed so a subsequent patch can conditionally add a bundle2
part to the "getbundle" wire protocol command depending on whether a
clone bundle was attempted.
2015-10-13 14:55:02 -07:00
Gregory Szorc
95a4a00349 exchange: provide hint on how to disable clone bundles
If a clone bundle persistently fails to apply, users need a way to
disable it so they have a hope of the clone working. Change the hint for
the abort scenario to advertise the config option to disable clone
bundles.
2015-10-13 12:41:32 -07:00
Gregory Szorc
143c4bca55 exchange: document filterclonebundleentries 2015-10-14 10:03:26 -07:00
Gregory Szorc
b794e37a76 wireproto: properly parse false boolean args (BC)
The client represents boolean arguments as '0' and '1'.
bool('0') == bool('1') == True, so a simple bool(val) isn't sufficient
for converting the argument back to a bool type.

Currently, "obsmarkers" is the only boolean argument to getbundle.

I /think/ the only place where we currently set the "obsmarkers"
argument is during bundle2 pulls. As a result of this bug, the server
/might/ be sending obsolete markers bundle2 part(s) to clients that
don't request them. That is why I marked this BC.

Surprisingly there was no test fall out from this change. I suspect a
lapse in test coverage.
2015-10-14 10:58:35 -07:00
Pierre-Yves David
e5984e269f bundle2: gracefully skip 'obsmarkers' part if evolution is disabled
We would skip the part if it was fully unknown, so we should also skip it if we
know we won't be able to apply it. This will allow us to produce bundles with
obsolescence markers alongside changegroup while still being able to apply them
on any client.
2015-10-15 03:29:00 +01:00
Pierre-Yves David
61d6614168 obsstore: make the readonly attribute accessible
We want to gracefully handle the read only case in some case (current target:
advisory obsmarkers parts in bundle2). So we expose the attribute in a clean
way.
2015-10-15 12:45:34 +01:00
Pierre-Yves David
e4483e415c update: introduce a 'UpdateAbort' exception
The 'postincoming' function used by 'hg pull --update' and 'hg unbundle' is
catching 'Abort' exceptions to intercept failed update. This feel a bit too
wide to me, so I'm introducing a more precise exception to specify update
destination issues.
2015-10-05 04:26:26 -07:00
Pierre-Yves David
3ca3ce920a update: "deprecate" call to 'merge.update' without a destination
Now that all internal callers pre-compute and set a destination at a higher level
it feels like we can kill this API. This will allow us to simplify this
function. However I feel like this is a bit too central and critical to break
now. I'm adding a devel warning to let extension make catch this in the next
cycle.
2015-10-05 21:42:09 -07:00
Christian Delahousse
59c67e69d3 shelve: delete shelve statefile on any exception during abort
When a user's repository is in an unfinished unshelve state and they choose to
abort, at a minimum, the repo should be out of that state. We've found
situations where the user could not leave the state unless manually deleting the
state file. This fix ensures that no matter what exception may be raised during
the abort, the shelved state file will be deleted, the user will be out of the
unshelve state and they can get their repository into a workable condition.
2015-10-14 20:35:06 -07:00
Gregory Szorc
c20551dc4f highlight: add option to prevent content-only based fallback
When Mozilla enabled Pygments on hg.mozilla.org, we got a lot of weirdly
colorized files. Upon further investigation, the hightlight extension
is first attempting a filename+content based match then falling back to a
purely content-driven detection mode in Pygments. Sounds good in theory.

Unfortunately, Pygments' content-driven detection establishes no minimum
threshold for returning a lexer. Furthermore, the detection code for
a number of languages is very liberal. For example, ActionScript 3 will
return a confidence of 0.3 (out of 1.0) if the first 1k of the file
we pass in matches the regex "\w+\s*:\s*\w"! Python matches on
"import ". It's no coincidence that a number of our extension-less files
were getting highlighted improperly.

This patch adds an option to have the highlighter not fall back to
purely content-based detection when filename+content detection failed.
This can be enabled to render unlighted text instead of taking the risk
that unknown file types are highlighted incorrectly. The old behavior is
still the default.
2015-10-14 18:22:16 -07:00
Gregory Szorc
8482c8a951 highlight: inline checkfctx()
It is only used once. pygmentize() is pretty small. Let's just inline
it.
2015-10-14 17:43:44 -07:00
Gregory Szorc
b5463251e9 highlight: consolidate duplicate code
I'm adding some logic in a future patch and this will make it so I only
have to add it once.
2015-10-14 17:42:07 -07:00
Christian Delahousse
3e8e422089 rebase: properly abort when destination is public (issue4896)
After rebasing a set of changes onto a public changeset and having the first one
be skipped, if you try to abort, the operation fails. This fix adds a check to
disallow the target rev into the dstates list within the abort function. This
list is checked for immutable states before the rest of abort does its thing.
2015-10-13 14:06:51 -07:00
Matt Mackall
5fb7b930ae bookmarks: don't deactivate on no-op update (issue4901) 2015-10-14 18:03:17 -05:00
Pierre-Yves David
d7f7b508bd rebase: properly handle chains of markers with missing nodes
As obsolescence markers can contains unknown nodes and 'allsuccessors' returns
them, we have to protect again that when looking for successors of the rebase
set in the destination.

Test have been expanded to catch that.
2015-10-15 00:32:20 +01:00
Pierre-Yves David
f0d9f208d1 rebase: use a direct reference to repo.changelog
Accessing 'repo.changelog' have a small overhead because we double check that the
filtering did not changed. As we make multiple use of this into loops, we should
avoid doing the lookup/check every time. This also make the code tidier.
2015-10-14 23:42:15 +01:00
timeless@mozdev.org
88f3ab0903 mail: drop python 2.5 support 2015-10-14 22:21:05 -04:00
Sean Farley
6ffbe0061e exchange: use pushop.repo instead of repo 2015-10-13 22:53:08 -07:00
Ryan McElroy
60f893df56 rebase: factor out nothing to rebase return code
A rebase call that results in nothing to rebase might be considered successful
in some contexts. This factors out the return code from places where hg
determines that there is nothing to rebase, so an extenion might change this
return code to be something that would allow scripts to run without seeing this
as an error.
2015-10-13 03:20:05 -07:00
Anton Shestakov
1ea7911d8a gitweb: visually highlight source lines when hovering over line numbers
Due to how the line links now reside outside of the source lines, hovering over
line numbers doesn't count as hovering over the appropriate source line. It can
be worked around by using a "+" css selector. However, it's necessary to
reorder the elements and put <a> before <span> (which is actually quite
logical). It works without further css tweaks because <a> is already
absolute-positioned and so the order doesn't matter visually.
2015-10-15 00:04:58 +08:00
Christian Delahousse
eac53b6308 rebase: added comments
Added comments describing the state variable and constants used throughout the
rebase extension
2015-10-13 14:17:15 -07:00