Commit Graph

28864 Commits

Author SHA1 Message Date
Jun Wu
cbd2df17c1 chgserver: remove _clearenvaliases
Since we expand environment variables in alias lazily, the _clearenvaliases
hack is no longer necessary.

This resolves an issue that a non-shell alias which has environment variables
in its arguments and is set to use pager will not use pager running with chg.
2016-05-06 23:57:56 +01:00
Jun Wu
318fb5a998 dispatch: defer environment variable resolution in alias commands (BC)
Before this patch, if there are environment variables in an alias command,
they will be expanded immediately when we first see the alias.

This will cause issues with chg, because environment variable updates will
not propagate to expanded arguments.

This patch makes "args" of "cmdalias" a property that will be calculated
every time when accessed.
2016-05-07 00:16:58 +01:00
Augie Fackler
643a3efe0a rollback: add a config knob for entirely disabling the command
This is of pretty high value for organizations that used to use p4 (as
an example), since `p4 rollback` is what we call `hg backout`.
2016-05-03 16:33:25 -04:00
Martin von Zweigbergk
f553986d8e templater: add separate() template function
A pretty common pattern in templates is adding conditional separators
like so:

  {node}{if(bookmarks, " {bookmarks}")}{if(tags, " {tags}")}

With this patch, the above can be simplified to:

  {separate(" ", node, bookmarks, tags)}

The function is similar to the already existing join(), but with a few
differences:

 * separate() skips empty arguments

 * join() expects a single list argument, while separate() expects
   each item as a separate argument

 * separate() takes the separator first in order to allow a variable
   number of arguments after it
2016-05-03 09:49:54 -07:00
Augie Fackler
419a5a94fb bookmarks: jettison bmstore's write() method per deprecation policy 2016-05-04 21:01:49 -04:00
Matt Mackall
2e8a8d9ec3 merge with stable 2016-05-05 15:12:43 -05:00
Pierre-Yves David
981a2cbeeb deprecation: gate deprecation warning behind devel configuration
Regular users are not supposed to be exposed to the API deprecation warnings.
We now only issue them when the developper warnings are enabled.
2016-05-05 16:29:31 +02:00
Anton Shestakov
2114fb5a2b crecord: update downarrowshiftevent() docstring, remove todo
The phrasing is mostly taken from uparrowshiftevent().
2016-05-05 19:51:35 +08:00
Anton Shestakov
5e327181ec crecord: remove things that don't happen in functions from their docstrings
Scrolling screen is currently done in a different place. The things that had
been described in the docstrings may still happen, but the functions touched by
this patch don't do any scrolling, they only set self.currentselecteditem and
nothing more.
2016-05-05 19:40:40 +08:00
Anton Shestakov
5e74474fd5 crecord: remove skipfolded keyword argument from patchnode.previtem()
It wasn't used, it wasn't implemented. Probably was a copy-paste bonus from
patchnode.nextitem()
2016-05-05 18:13:25 +08:00
Anton Shestakov
abe8039328 crecord: update a copy-pasted comment in downarrowshiftevent() 2016-05-05 15:19:37 +08:00
Pierre-Yves David
1df58e3451 crecord: drop the version condition for amend
The UI is now shipped in core, amend feature is always available.
2016-05-05 16:38:24 +02:00
Anton Shestakov
2a1482cb0e crecord: add/remove blank lines (coding style) 2016-05-05 11:19:52 +08:00
Augie Fackler
5a2af0bc22 bookmarks: properly invalidate volatile sets when writing bookmarks
This corrects a regression introduced during the 3.7 cycle, but which
went undetected due to the surviving-but-deprecated write() method on
bmstore.
2016-05-04 22:44:30 -04:00
Augie Fackler
eb85279af2 test-obsolete: update extension in test to actually work
This hasn't been testing anything since partway through the 3.7 cycle
due to unrelated refactoring. Sadly, the behavior it was trying to
prevent reemerged in the codebase at that time. A fix is in the next
patch, because proving that the fix was actually correct ended up
being trickier than I expected.
2016-05-05 15:41:37 +02:00
Mike Hommey
50e9c3bb84 bundle2: properly request phases during getbundle
getbundle was requesting the "phase" namespace instead of the "phases"
namespace, which led to the client still requesting the phases
separately after getbundle finished.
2016-05-05 20:57:38 +09:00
Augie Fackler
8815201972 localrepo: jettison parents() method per deprecation policy (API) 2016-05-04 21:02:03 -04:00
Matt Mackall
539d61b5dc Added signature for changeset 38662341e581 2016-05-01 14:36:12 -05:00
Yuya Nishihara
96d6f9fd5f revset: define _parsealias() in _aliasrules class
It's short. It doesn't make sense to define _parsealias() outside of the
class.
2016-04-17 13:06:44 +09:00
Yuya Nishihara
74d711b196 revset: factor out common parsing function 2016-04-17 13:03:23 +09:00
Yuya Nishihara
2838ac3dce revset: inline _tokenizealias() into _parsealias()
This helps factoring out common part between _parsealias() and parse().
2016-04-17 12:57:27 +09:00
timeless
d41c3c219d store: treat range as a generator instead of a list for py3 compat 2016-04-10 07:28:26 +00:00
Jun Wu
de167181c6 ui: add new config option for help text width
Before this patch, when printing help text using `hg help`, or `hg log -h`,
the output will wrap at 78 chars even if the user has a bigger terminal width
and there is no config option to change it, making the experience different
from the commonly used `man` tool.

This patch introduces a new config option `ui.textwidth`, which replaces the
hardcoded number. It's set to 78 by default to maintain compatibility. When
set to 0, `hg help` will behave more like `man`.
2016-05-04 18:18:24 +01:00
timeless
6cc058ae3c tests: test histedit base command plan help 2016-05-03 15:26:51 +00:00
liscju
45a5b8ca24 largefiles: makes verify batching stat calls to remote
Instead of sending stat calls for each files separately, it sends
one batch call with stat invocations for all files.
2016-05-03 23:48:31 +02:00
liscju
31a5cfa252 largefiles: change basestore._verifyfile to take list of files to check
Makes it easier to use batch stat calls in remotestore to decrease
number of round trips.
2016-05-03 23:31:32 +02:00
timeless
95228c418a rebase: handle successor targets (issue5198)
When a parent has a successor (indicated by revprecursor in state),
we need to use it.
2016-04-11 21:33:07 +00:00
Mike Hommey
7df6eb0ad6 debugbundle: add tests for debugbundle output with bundle2 2016-05-04 06:44:44 +09:00
Nathan Goldbaum
6f4adfc536 revert: mention ui.origbackuppath in the command help 2016-05-04 10:46:27 -05:00
Sean Farley
dcd80c4774 help: wrap ".orig" in rst quotes
Apparently, .orig. is a macro for man pages so we need to wrap it in quotes to
silence lintian warnings.
2016-04-30 18:40:34 -07:00
Yuya Nishihara
10fda3d262 parser: shorten prefix of alias parsing errors
These messages seemed to be a bit long. We should try making them fit to
80-col console.
2016-04-17 12:31:06 +09:00
Yuya Nishihara
77a605117c parser: rephrase "'$' not for alias arguments" message
Say which symbol caused the error. The word "alias" is removed since these
messages are prefixed by "failed to parse ... revset alias "...":".
2016-04-17 12:20:57 +09:00
Mike Hommey
cf14a5ca18 debugbundle: handle the --all option for bundle2 2016-04-18 17:54:02 +09:00
Tony Tung
9f3c4b8958 manifest: improve filesnotin performance by using lazymanifest diff
lazymanifests can compute diffs significantly faster than taking the set
of two manifests and calculating the delta.

when running hg diff --git -c . on Facebook's big repo, this reduces the
run time from 2.1s to 1.5s.
2016-05-02 15:22:16 -07:00
Christian Ebert
81c2d303c5 keyword: replace use of _filerev with _filenode
To be independent of rev numbers.
Analogous to b558712637b8.
2016-04-19 11:00:15 +01:00
Blake Burkhart
a5bebc504a convert: pass absolute paths to git (SEC)
Fixes CVE-2016-3105 (1/1).

Previously, it was possible for the repository path passed to git-ls-remote
to be misinterpreted as a URL.

Always passing an absolute path to git is a simple way to avoid this.
2016-04-06 22:57:46 -05:00
Matt Mackall
c9c3060889 Added signature for changeset 89e922ed00c5 2016-05-01 13:52:26 -05:00
Sean Farley
41d6e5ed5b debian: alphabetize build deps 2016-04-30 21:21:17 -07:00
Sean Farley
35d3b6884b debian: fix lintian warning about debhelper
It seems this is correct but does it work on older distros? I ran the
docker-jessie rule and didn't get any warnings.
2016-04-30 17:26:48 -07:00
Sean Farley
8b7c1af14d builddeb: remove chmod as lintian tells us
It turns out we just need debian/rules to be executable, so we do just that.
2016-04-30 17:29:12 -07:00
Sean Farley
205b5f811e builddeb: use codename in version
Apparently, this is needed to allow ppas to be built for multiple distros.
2016-04-30 11:51:45 -07:00
Pierre-Yves David
aab6e0ee27 rebase: restrict rebase destination to the pulled set (issue5214)
Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull`
followed by `hg rebase` if anything was pulled.

Now that rebase pick his default destination the same way than merge, than
`hg rebase` step would abort in the case the repo already had multiple anonymous
heads (because of the ambiguity). (changed in 8822059a608a)

The intend of the user with `hg pull --rebase` is clearly to rebase on pulled
content. This used to be (mostly) enforced by the former default destination for
rebase, "tipmost changeset of the branch" as the tipmost would likely a
changeset that just got pulled. But this intended was no longer enforced with
the new defaul destination (unified with merge).

This changeset makes use of the '_destspace' mechanism introduced in the previous
changeset to enforce this.

This partially fixes issue5214 as no change at all have been made to the new
handling of the case with bookmark (unified with merge).
2016-04-30 18:39:39 +02:00
Pierre-Yves David
da0dc4d591 destutil: add the ability to specify a search space for rebase destination
In the 'hg pull --rebase', we don't want to pick a rebase destination unrelated
to the pull, we lay down basic infrastructure to allow such restriction on
stable (before 3.8 release) in this case. See issue 5214 for details.

Actual usage and test will be in the next patch.
2016-04-30 18:41:08 +02:00
Gregory Szorc
ad77315d76 sslutil: restore old behavior not requiring a hostname argument (issue5210)
This effectively backs out changeset 60b56b3206cc.

The http library behind ui.http2=true isn't specifying the hostname.
It is the day before the expected 3.8 release and we don't want to ship
a regression.

I'll try to restore this requirement in the 3.9 release cycle as part
of planned improvements to Mercurial's SSL/TLS interactions.
2016-04-30 09:26:47 -07:00
Matt Mackall
9cda77e1b1 tests: test a variety of cache invariants
We've historically had a problem maintaining the expected invariants
on our caches, especially when introducing new caches. This tests
documents the invariants and exercises them across most of our
existing cache files.
2016-04-28 16:38:15 -05:00
Matt Mackall
a684f1361f repoview: ignore unwritable hidden cache
The atomictemp.close() file attempts to do a rename, which can fail.
Moving the close inside the exception handler fixes it.

This doesn't fit well with the with: pattern, as it's the finalizer
that's failing.
2016-04-28 16:26:18 -05:00
Matt Mackall
37e825cd02 tags: silence hgtagsfnodes reading failures
tryread() doesn't handle "is a directory" errors and presumably
others. We might not want to globally swallow such tryread errors, so
we replace with our own try/except handling.

An upcoming test will use directories as a portable stand-in for
various bizarre circumstances that cache read/write code should be
robust to.
2016-04-28 15:40:43 -05:00
Matt Mackall
8ad154abd6 tags: silence cache parsing errors
Follow our standard STFU cache-handling pattern
2016-04-28 15:35:54 -05:00
Wagner Bruna
9fe82bf618 i18n-pt_BR: synchronized with 2ae54831e766 2016-05-01 00:12:56 -03:00
Sean Farley
ca1aff7fdb ubuntu-xenial-ppa: add makefile rule 2016-04-27 01:07:40 -07:00