Commit Graph

6066 Commits

Author SHA1 Message Date
Pierre-Yves David
9ec0d7ca98 color: drop the 'colorui' class
Now that all logics formally bared by 'colorui' have been moved to the main ui
class, that class is empty and can be dropped. As a nice side effect we can get
rid of the baroque Initialization associated to it.

There was much rejoicing.
2017-02-20 12:42:35 +01:00
Pierre-Yves David
7636ff5278 color: move 'write-err' logic to the core ui class
This is similar to what we needed for 'write', we move the logic from the
extension to the core class. Beside the dispatch to 'win32print', we just apply
label to the argument.
2017-02-20 12:42:23 +01:00
Pierre-Yves David
26de620d6b color: move 'write' logic to the core ui class
One more step, the support for writing color is not directly in core. No
behavior change for the default case ('_colormode' = None).

Here are the details of what we have to change to the core method:

 * apply to 'self.label' to input in the buffered case
 * dispatch to 'win32print' when applicable
 * apply to 'self.label' to input when applicable
2017-02-20 12:31:39 +01:00
Pierre-Yves David
e346e78cd5 color: add multiple messages input support to 'win32print'
All other function doing writes support any number of input message. For
simplicity, we make 'win32print' able to do the same.
2017-02-24 21:34:07 +01:00
Pierre-Yves David
30677aa45c color: move the 'colorlabel' call to the core 'ui' class
This bring us closer to supporting color in core natively. Core already have a
'label' method that was a no-op. We update its to call the new 'colorlabel'
function. Behavior is unchanged when colormode = None.
2017-02-23 19:45:32 +01:00
Pierre-Yves David
88e8699e8f color: move the 'colorlabel' function in the core module
The extract code is relocated in core.
2017-02-23 19:10:24 +01:00
Pierre-Yves David
f7032f18df color: extract the label code into its own function
We extract the logic into a function. This will allow us to move the logic into
the core 'color' module and later call it directly from core.
2017-02-23 19:00:26 +01:00
Pierre-Yves David
c28f2900b0 color: inline the 'showlabel' method
This function is quite simple and only have one call site… located a handful of line
under the definition. We inline the function for the sake of simplicity. One of
the motivation to do that now is that it reduce the amount of new method we
will have to add to the core 'ui' class for color support.
2017-02-20 12:13:23 +01:00
Pierre-Yves David
3a2218f308 color: move '_colormode' to the core 'ui' class
Having all 'ui' objects aware of 'color' allows us to update the core code to
handle color. The mode will stay 'None' in the default case so that will not
introduce any changes.
2017-02-20 12:12:08 +01:00
Pierre-Yves David
2b091caddc color: set initial default value for 'colormode' to None
This should not introduce any behavior changes when using the color extension.
In practive, the colormode will be setup at early at run time to the proper
value (from config and environment).

We do this change as this gets us closer of a state were we can have all the
mechanisms associated to color in core with the feature disabled by default.
2016-12-22 06:18:45 +01:00
Pierre-Yves David
6a72272bdb color: merge two identical 'for' loops
The previous changeset made it clear that we are iterating twice on the same
items. We gather the two loops into a single one.
2017-02-16 10:52:27 +01:00
Pierre-Yves David
ea8940a79d color: minor simplification of some terminfo setup code
No logic change is introduced. The previous code were using a 'dict.update' with
a complex generator. That was a bit confusing to read and not so compact.
Instead we now use an explicit loop and conditional for the sake of clarity.

This also allow for more simplification coming in the next changeset.
2016-12-22 13:06:53 +01:00
Pierre-Yves David
f6a9369fbf color: make a test for curse availability explicite
We won't use terminfo when curse failed to load. Before this change, we were
doing an indirect test, relying on the fact some variable ('_terminfo_params')
would be empty if curses failed to load. We update the code to be more explicit
and directly checks if we managed to load the curse module.
2016-12-22 06:17:40 +01:00
Pierre-Yves David
27dabab2f3 color: move 'win32' declaration to the core module
This is another part of moving color implementation into core. before we can
move the advance logic, we need to move the basic definition and building
bricks. This is one more step on that road.
2016-12-22 03:11:19 +01:00
Augie Fackler
2e832efca3 pager: move most help to a new help topic and deprecate extension 2017-02-07 00:07:53 -05:00
Ben Schmidt
20f9183d45 histedit: modify rollup to discard date from the rollup commit (issue4820)
This change adjusts and documents the new behaviour of 'roll'. It now fits nicely
with the behaviour of 'commit --amend' and the 'edit' action, by discarding the
date as well as the commit message of the second commit. Previously it used the
later date, like 'fold', but this often wasn't desirable, for example, in the
common use case of using 'roll' to add forgotten changes to a changeset
(because 'hg add' was previously forgotten or not all changes were identified
while using 'hg record').
2017-02-18 21:30:28 +11:00
Ben Schmidt
a0e44b6af4 histedit: improve documentation and behaviour of dates
This clarifies in the histedit documentation that the 'edit' action preserves
the date and that the 'fold' action uses the later date. The documentation was
previously silent on this issue which left users in doubt.
2017-02-18 21:30:28 +11:00
FUJIWARA Katsunori
25ed007f6f bookmarks: check HG_PENDING strictly
Before this patch, checking HG_PENDING in bookmarks.py might cause
unintentional reading unrelated '.hg/bookmarks.pending' in, because it
just examines existence of HG_PENDING environment variable.

This patch uses txnutil.trypending() to check HG_PENDING strictly.

This patch also changes share extension.

Enabling share extension (+ bookmark sharing) makes
bookmarks._getbkfile() receive repo to be shared (= "srcrepo"). On the
other hand, HG_PENDING always refers current working repo (=
"currepo"), and bookmarks.pending is written only into currepo.

Therefore, we should try to read .hg/bookmarks.pending of currepo in
at first. If it doesn't exist, we try to read .hg/bookmarks of srcrepo
in.

Even after this patch, an external hook spawned in currepo can't see
pending changes in currepo via srcrepo, even though such changes
become visible after closing transaction, because there is no easy and
cheap way to know existence of pending changes in currepo via srcrepo.

Please see https://www.mercurial-scm.org/wiki/SharedRepository, too.

BTW, this patch may cause failure of bisect in the repository of
Mercurial itself, if examination at bisecting assumes that an external
hook can see all pending changes while nested transactions across
repositories.

This invisibility issue will be fixed by subsequent patch, which
allows HG_PENDING to refer multiple repositories.
2017-02-21 01:21:00 +09:00
Augie Fackler
bcf9ea0406 qdiff: migrate to modern pager API
This results in the default pager-attend list being empty. Sadly, we
can't let the code be that way, because some legacy extensions depend
on hooking the pager's attend list at import time (and we'd like to
not break them), and if the list is actually *empty* that triggers
magic behavior in the extension that attends everything. Instead, we
put a long, improbable command name as the only entry in the attend
list.
2017-02-06 23:57:21 -05:00
Augie Fackler
31938f0650 log: migrate to modern pager API 2017-02-06 22:59:25 -05:00
Augie Fackler
776882e795 export: migrate to modern pager API 2017-02-06 22:58:54 -05:00
Augie Fackler
a057b6046c diff: migrate to modern pager API 2017-02-06 22:58:26 -05:00
Augie Fackler
4452f8a320 cat: migrate to modern pager API 2017-02-06 22:57:52 -05:00
Yuya Nishihara
b2229f5117 revset: split language services to revsetlang module (API)
New revsetlang module hosts parser, tokenizer, and miscellaneous functions
working on parsed tree. It does not include functions for evaluation such as
getset() and match().

  2288 mercurial/revset.py
   684 mercurial/revsetlang.py
  2972 total

get*() functions are aliased since they are common in revset.py.
2017-02-19 18:19:33 +09:00
Yuya Nishihara
d63d83be69 revset: import set classes directly from smartset module
Follows up 97d0be4019ac.
2017-02-19 18:16:09 +09:00
liscju
f5ef66440e shelve: add -n/--name option to unshelve (issue5475)
This makes using shelve/unshelve more consistent because
shelving can be done using name option and unshelving as
well. Author of the idea of this improvement and solution is
joshgold.
2017-02-19 10:56:08 +01:00
Augie Fackler
c7eae9f3c3 annotate: migrate to modern pager API 2017-02-06 22:52:47 -05:00
Augie Fackler
59b1009800 ui: add ignore-single-command functionality
This closes the last feature gap other than the attend list from the
extension. For now, I'm leaving the attend list in the extension,
because I'm unsure it has merit in a world where commands have been
updated to take advantage of the modern API.
2017-02-06 23:21:45 -05:00
Augie Fackler
3967c4ed9b pager: move more behavior into core
This moves the global flag and the --pager=yes logic into core. Only
functionality change is that users now always get a --pager flag and
can enable the pager via the flag without the extension active.

Moving the flag into core exposes a defect in the ro localization,
which will have to be corrected later.
2017-02-15 17:47:57 -05:00
Augie Fackler
09219ff69c pager: move pager-initiating code into core
No functionality change.

A previous version of this API had a category argument on
ui.pager(). As I migrated the commands in core, I couldn't come up
with good enough consistency in any categorization scheme so I just
scrapped the whole idea. It may be worth revisiting in the future.
2017-02-15 17:47:51 -05:00
Simon Farnsworth
2d5b62ae12 histedit: log the time taken to read in the commands list
If we're being fed an external command list from stdin (histedit --commands -),
then the time spent reading stdin is outside our control. Log it.
2017-02-15 13:34:06 -08:00
Simon Farnsworth
e84349b277 extdiff: log time spent in external diff program
We can't fix the time external diff programs take to run. Log that duration
for us to remove from any stats we gather
2017-02-15 13:34:06 -08:00
Pierre-Yves David
d3cdbad5e6 color: move the '_render_effects' function to the core module 2016-12-22 02:38:53 +01:00
Pierre-Yves David
59ecec91a4 color: move '_effect_str' function into the core module 2016-12-22 02:37:18 +01:00
Pierre-Yves David
0f0fe390dc color: move configstyles into the core module
The extension is getting thinner as we speak!
2016-12-22 02:34:22 +01:00
Pierre-Yves David
fcd5d56250 color: move 'valideffect' function into the core module 2016-12-22 02:26:50 +01:00
Pierre-Yves David
98d6e487dc color: move '_terminfo_params' into the core 'color' module
On step closer to have color in core.
2016-12-22 02:23:23 +01:00
Pierre-Yves David
2c4222ad04 color: move '_effect' mapping into core
This is the second things we can move into core safely.
2016-11-18 18:48:38 +01:00
Pierre-Yves David
19558426fc color: spread '_effect' values for readability
We move to our "usual" one value per line style.
2016-11-18 18:43:39 +01:00
Pulkit Goyal
56031921a5 py3: convert the mode argument of os.fdopen to unicodes (2 of 2) 2017-02-13 22:15:28 +05:30
John Mulligan
01f8fb7c8f bugzilla: add a rest api backend (usable with bugzilla 5.0+)
Add support for the bugzilla rest api documented at
 https://wiki.mozilla.org/Bugzilla:REST_API
and at
 https://bugzilla.readthedocs.io/en/latest/

This backend has the following benefits:
* It supports the bugzilla api keys so hgrc does not need to contain
  a user's bugzilla password
* Works with Mercurial's "hostfingerprints" support making handling
  bugzilla instances with self-signed certs easier
* Does not use xmlrpc ;-)

Adds configuration item 'apikey' in [bugzilla] section.

My major concern with these patches is if the approach to HTTP access
is the right way for an extension and if hooking into request object
and the overriding the get_method to perform PUT requests was a
sensible approach.

# no-check-commit
2017-02-09 15:20:41 -05:00
Simon Farnsworth
5f644ba68a pager: exit cleanly on SIGPIPE (BC)
Changeset 8b50aee1f75c removes SIGPIPE handling completely. This is wrong,
as it means that Mercurial does not exit when the pager does. Instead, raise
SignalInterrupt when SIGPIPE happens with a pager attached, to trigger the
normal exit path.

This will cause "killed!" to be printed to stderr (hence the BC warning),
but in the normal pager use case (where the pager gets both stderr and
stdout), this message is lost as we only get SIGPIPE when the pager quits.
2017-02-08 07:44:10 -08:00
Simon Farnsworth
8a0451d60e zeroconf: fail nicely on IPv6 only system
zeroconf only knows how to deal with IPv4; I develop on a system where the only
IPv4 address is 127.0.0.1.

Teach zeroconf to ignore IPv6 addresses when looking for plausible IPv4
connectivity.
2017-02-08 08:08:41 -08:00
Yuya Nishihara
0e09faf65f help: uppercase command placeholder
'command' isn't a valid help topic but a placeholder text. Make it upper
case to avoid confusion.
2017-01-25 22:35:40 +09:00
Simon Farnsworth
6a6899c4d4 util: always force line buffered stdout when stdout is a tty (BC)
pager replaced stdout with a line buffered version to work around glibc
deciding on a buffering strategy on the first write to stdout. This is going
to make my next patch hard, as replacing stdout will make tracking time
spent blocked on it more challenging.

Move the line buffering requirement to util.py, and remove it from pager.
This means that the abuse of ui.formatted=True and pager set to cat or equivalent
no longer results in a line-buffered output to a pipe, hence (BC), although
I don't expect anyone to be affected
2017-02-03 15:10:27 -08:00
Simon Farnsworth
591b9bb95d pager: don't terminate with extreme prejudice on SIGPIPE (BC)
The default SIGPIPE handler causes Mercurial to exit immediately, without
running any Python cleanup code (except and finally blocks, atexit handlers
etc). This creates problems if you want to do something at exit.

If we need a different exit code for broken pipe from pager, then we should
code that ourselves in Python; this appears to have been cargo-culted from
the fork implementation of pager that's no longer used, where it was needed
to stop Broken Pipe errors appearing on the user's terminal.
2017-02-02 11:17:36 -08:00
Martin von Zweigbergk
35aa8c2fe5 rebase: fix code comment to refer to right issue (4504, not 4505)
The comment was introduced in 0a14c8556910 (rebase: ensure rebase
revision remains visible (issue4504), 2015-01-27), which mentions the
right issue in the description.
2017-02-01 08:47:27 -08:00
Pulkit Goyal
d310fba3dd py3: have a bytes version of shlex.split()
shlex.split() only accepts unicodes on Python 3. After this patch we will be
using pycompat.shlexsplit(). This patch also replaces existing occurences of
shlex.split with pycompat.shlexsplit.
2016-12-25 03:06:55 +05:30
Augie Fackler
d2c2a6fb47 rebase: un-wrap function signature since it fits in 80 columns 2016-12-24 15:38:27 -05:00
Pulkit Goyal
b94e592b62 shelve: choose a legal shelve name when no name is passed (issue5112)
Currently if our branch name contains '\' or starts with '.', shelve chooses
an illegal shelve name. This behaviour is not good as it itself is choosing
something which it won't accept further. We can raise errors if user passes
a name which is illegal.
After this patch, if '\' is contained in branch name or bookmark name, it will
be replaced by '_' while choosing a shelve name and if they starts with '.',
the first '.' is replaced by '_'.
2016-12-22 19:35:30 +05:30
Pulkit Goyal
589ad4d6b7 py3: use python 3 compatible variables in hgext/fsmontor/__init__.py
Earlier this was left thinking that its part of pywatchman package.
This patch replaces variables os.sep, sys.platform and os.envrion with their
py3 compatible ones.
2016-12-21 23:40:38 +05:30
Pulkit Goyal
770a0e2938 py3: replace os.getenv with pycompat.osgetenv
os.getenv deals with unicodes on Python 3, so we have pycompat.osgetenv to
deal with bytes. This patch replaces occurrences on os.getenv with
pycompat.osgetenv
2016-12-19 02:54:49 +05:30
Gregory Szorc
57ef32586b convert: add config option to control storing original revision
common.commit.__init__ sets saverev=True by default. The side effect
of this is that the hg sink will always set the "convert_revision"
extras key to the commit being converted.

This patch adds a config option to disable this behavior.

While most consumers will want "convert_revision" to be a) written
b) with the exact Git commit that was converted, some have use cases
that prefer otherwise. In my case, I am performing significant
rewrites of a Git repository *before* it is fed into `hg convert`.
I have to do this because `hg convert` does not easily support the kind
of transform I desire, even with extensions. (For the curious, I am
"linearizing" the history of a GitHub repo by removing merge commits
which add little value to the final history. It isn't easy to do this
during `hg convert` because of Mercurial's file copy/rename metadata
requirements.)

In my scenario, my pre-convert transform stores a "convert_revision"
key in the Git commit object containing the original Git commit ID.
I want this original Git commit ID carried forward to Mercurial. By
disabling the setting of this extra during `hg convert` and copying
the value from the Git commit object, I can have the final
"convert_revision" extra key contain the original Git commit ID. An
added test verifies this exact scenario.

This feature could likely be implemented for other VCS sources. But
until someone needs the feature, I'm inclined to hold off implementing.
2016-12-22 23:28:35 -07:00
Gregory Szorc
6c0707a02c convert: add config option to copy extra keys from Git commits
Git commit objects support storing arbitrary key-value metadata. While
there is no user-facing mechanism in Git to record these values, some
tools do record data here.

Currently, `hg convert` only handles the "author," "committer," and
"parent" keys in Git commit objects. All other keys are ignored. This
means that any custom keys are lost when converting Git repos to
Mercurial.

This patch implements support for copying a whitelist of extra keys
from Git commit objects to the "extras" dict of the destination. As
the added tests demonstate, this allows extra metadata to be preserved
during the conversion process.

This patch stops short of converting all metadata to "extras." We could
potentially implement this via `convert.git.extrakeys=*` or similar.
But copying everything by default is a bit dangerous because if Git
adds new keys to commit objects, we could find ourselves copying
things that shouldn't be copied!

This patch also assumes the source key is the same as the destination
key. We could implement support for prefixing the output key to
distinguish it as coming from Git. But until this feature is needed,
I'm inclined to hold off implementing it.
2016-12-22 23:28:11 -07:00
Gregory Szorc
b79026697e convert: don't use {} as default argument value
This is a common Python gotcha. I'm kinda surprised we don't have a
check-code to detect this :/
2016-12-22 09:26:47 -08:00
Zack Hricz
ca776e404a fsmonitor: refresh pywatchman to upstream
Update to upstream to version c77452. The refresh includes fixes to improve
windows compatibility.

There is a minor update to 'test-check-py3-compat.t' as c77452 no longer have
the py3 compatibility issues the previous version had.

# no-check-commit
2016-12-22 11:22:32 -08:00
Pierre-Yves David
9ff835aa99 color: load 'colortable' from extension using an 'extraloader'
Now that we have the '_style' dictionary in core, we can use the clean and
standard 'extraloader' mechanism to load extension's 'colortable'.
color.loadcolortable
2016-11-18 18:18:15 +01:00
Pierre-Yves David
59221a2230 color: move hgext.color._styles to mercurial.color.style
This is small first step to start moving the color infrastructure into core. The
current code of the color extensions is full of strange and debatable things,
we'll clean it up in the process as having things into core help the cleaning.

Moving _style was the simplest sensible move that is possible. It will also help
cleaning up the extension setup process in a later changesets.
2016-11-18 18:09:36 +01:00
Pierre-Yves David
124732c109 color: drop use of the 'global' keyword for '_style'
Using 'global' is usually a bad sign. Here it is used so that one can empty the
content of a dict at the global scope. We '_style.clear()' and drop the global.
2016-11-18 18:29:19 +01:00
Pierre-Yves David
bf00b0d218 color: drop use of the 'global' keyword for _terminfo_params
Using 'global' is usually a bad sign. Here it is used so that one can empty the
content of a dict at the global scope. We '_terminfo_params.clear()' and
drop the global.
2016-11-18 18:27:13 +01:00
zphricz
c8184ea2e2 fsmonitor: fix exception message scraping
pywatchman.CommandError formats its error message such that
'unable to resolve root' is not a prefix. This change fixes that by
instead just searching for it as a substring.
2016-12-21 13:51:34 -08:00
Gregory Szorc
8f73471951 convert: config option for git rename limit
By default, Git applies rename and copy detection to 400 files. The
diff.renamelimit config option and -l argument to diff commands can
override this.

As part of converting some repositories in the wild, I was hitting
the default limit. Unfortunately, the warnings that Git prints in this
scenario are swallowed because the process running functionality in
common.py redirects stderr to /dev/null by default. This seems like
a bug, but a bug for another day.

This commit establishes a config option to send the rename limit
through to `git diff-tree`. The added tests demonstrate a too-low
rename limit doesn't result in copy metadata being recorded.
2016-12-18 12:53:20 -08:00
Pulkit Goyal
d35cffe17d py3: replace sys.platform with pycompat.sysplatform (part 2 of 2) 2016-12-19 02:26:41 +05:30
Pulkit Goyal
1f6538b90b py3: replace os.name with pycompat.osname (part 2 of 2) 2016-12-19 00:28:12 +05:30
Pulkit Goyal
9251b69fc4 py3: replace os.environ with encoding.environ (part 5 of 5) 2016-12-18 02:08:59 +05:30
Pulkit Goyal
1a4248666b py3: replace os.environ with encoding.environ (part 2 of 5) 2016-12-18 01:46:39 +05:30
David Soria Parra
34b35d6c71 convert: parse perforce data on-demand
We are using read-only attributes that parse the perforce data on
demand. We are reading the data only once whenever an attribute is
requested and use it throughout the import process. This is equivalent
to the previous behavior, but we are avoiding reading from perforce when
we initialize the object, but instead run it during the actual import
process, when the first attribute is requested (usually getheads(), see
`convertcmd.convert`).
2016-12-20 09:23:50 -08:00
David Soria Parra
74a69748a6 convert: return calculated values from parse() instead of manpulating state 2016-12-20 09:23:50 -08:00
David Soria Parra
aede854a35 convert: move localname state to function scope 2016-12-20 09:23:50 -08:00
David Soria Parra
41ea64b87e convert: use return value in parse_view() instead of manipulating state 2016-12-20 09:23:50 -08:00
Yuya Nishihara
cf9b8abe16 convert: remove unused-but-set variable introduced in d68d4752d365
Spotted by pyflakes.
2016-12-18 16:20:04 +09:00
Pulkit Goyal
908a677054 py3: replace os.sep with pycompat.ossep (part 4 of 4) 2016-12-17 20:24:46 +05:30
Yuya Nishihara
601f618d04 convert: inline strutil.rfindall()
This is the only place where strutil is used. I don't think it's worth to
keep the strutil module, so inline it.

Also, strutil.rfindall() appears to have off-by-one error. 'end = c - 1' is
wrong because 'end' is exclusive.
2016-10-16 16:58:43 +09:00
David Soria Parra
dab6f08428 convert: return commit objects for revisions in the revmap
Source revision data that exists in the revmap are ignored when pulling
data from Perforce as we consider them already imported. In case where
the `convertcmd.convert` algorithm requests a commit object for such
a revision we are creating it.  This is usually the case for parent of
the first imported revision.
2016-12-14 12:07:23 -08:00
David Soria Parra
52774a1f49 convert: encapsulate commit data fetching and commit object creation
Split fetching the `describe` form from Perforce and the commit object creation
into two functions. This allows us to reuse the commit construction for
revisions passed from a revmap.
2016-12-13 21:49:58 -08:00
David Soria Parra
8040456970 convert: do not provide head revisions if we have no changests to import
Don't set a head revision in cases where we have a revmap but no
changesets to import, as convertcmd.convert() treats them as heads of
to-imported revisions.
2016-12-13 21:49:58 -08:00
David Soria Parra
4683ce4a8a convert: allow passing in a revmap
Implement `common.setrevmap` which is used to pass in a file with existing
revision mappings. This functionality is used by `convertcmd.convert` if it
exists and allows implementors such as the p4 converter to make use of an
existing mapping.

We are using the revmap to abort scanning and the repository for more information
if we already have the revision. This means we are allowing incremental imports
in cases where a revmap is provided.
2016-12-14 01:45:57 -08:00
David Soria Parra
cde8421946 convert: use convert_revision for P4 imports
We are using convert_revisions in other importers. In order to unify this
we are also using convert_revision for Perforce in addition to the original
'p4'.
2016-12-13 21:49:58 -08:00
David Soria Parra
eeb4ddccf3 convert: remove unused dictionaries
self.parent, self.lastbranch and self.tags have never been used.
2016-12-14 01:45:17 -08:00
David Soria Parra
5b7b900ca3 convert: self.heads is a list
self.heads is used as a list throughout convert and never a dictionary.
Initialize it correctly to a list.
2016-12-14 01:43:47 -08:00
David Soria Parra
338550df2b convert: don't use long list comprehensions
We are iterating over p4changes. Make the continue condition more clear
and easier to add new conditions in future patches, by removing the list
comprehension and move the condition into the existing for-loop.
2016-12-13 21:49:58 -08:00
Jun Wu
3f639e27a5 rebase: calculate ancestors for --base separately (issue5420)
Previously, the --base option only works with a single "branch" - if there
is one changeset in the "--base" revset whose branching point(s) is/are
different from another changeset in the "--base" revset, "rebase" will error
out with:

  abort: source is ancestor of destination

This happens if the user has multiple draft branches, and uses "hg rebase -b
'draft()' -d master", for example. The error message looks cryptic to users
who don't know the implementation detail.

This patch changes the logic to calculate the common ancestor for every
"base" changeset separately so we won't (incorrectly) select "source" which
is an ancestor of the destination.

This patch should not change the behavior where all changesets specified by
"--base" have the same branching point(s).

A new situation is: some of the specified changesets could be rebased, while
some couldn't (because they are descendants of the destination, or they do
not share a common ancestor with the destination). The current behavior is
to show "nothing to rebase" and exits with 1.

This patch maintains the current behavior (show "nothing to rebase") even if
part of the "--base" revset could be rebased. A clearer error message may be
"cannot find branching point for X", or "X is a descendant of destination".
The error message issue is tracked by issue5422 separately.

A test is added with all kinds of tricky cases I could think of for now.
2016-11-28 05:45:22 +00:00
Kostia Balytskyi
9b01b1d353 shelve: move patch extension to a string constant
We are using 'name + ".patch"' pattern throughout the shelve code to
identify the existence of a shelve with a particular name. In two
cases however we use 'name + ".hg"' instead. This commit makes
'patch' be used in all places and "emphasizes" it by moving
'patch' to live in a constant. Also, this allows to extract file
name without extension like this:
    f[:-(1 + len(patchextension))]
instead of:
    f[:-6]
which is good IMO.

This is a first patch from this initial "obsshelve" series. This
series does not include tests, although locally I have all of
test-shelve.t ported to test obs-shelve as well. I will send tests
later as a separate series.
2016-11-29 07:20:03 -08:00
Augie Fackler
f37a723203 merge with stable 2016-11-27 20:44:52 -05:00
Simon Farnsworth
3fe60954bc fsmonitor: be robust in the face of bad state
fsmonitor could write out bad state if interrupted part way through, and
would then crash when it tried to read it back in.

Make both sides of the operation more robust - reading state should fail
cleanly, and we can use atomictemp to write out cleanly as the file is
small. Between the two, we shouldn't crash with an IndexError any more.
2016-11-25 07:30:46 -08:00
Mads Kiilerich
9c5f48e630 shelve: add missing space in help text
The change is trivial and unlikely to have been translated so we update
translation files too.
2016-11-14 22:43:25 +01:00
Mads Kiilerich
4409f61ab2 largefiles: handle that a found standin file doesn't exist when removing it
I somehow ended up in a situation where hg crashed on an unlink I introduced in
8fd3fc1ef4c6.

I don't know how it happened and can't reproduce it. It seems like it only can
happen when the file is removed between the time of check in a working
directory context walk that finds a standin file, and the time of use when we
try to remove it because the corresponding largefile doesn't exist.

But better safe than sorry: replace the plain unlink with unlinkpath with
ignoremissing=True. That will also remove remaining empty directories, which
arguably is more correct.
2016-10-27 20:06:33 +02:00
Kevin Bullock
734a4f1625 merge default into stable for 4.0 code freeze 2016-10-18 14:15:15 -05:00
Mads Kiilerich
8f6d6ccc08 largefiles: fix 'deleted' files sometimes persistently appearing with R status
A code snippet that has been around since largefiles was introduced was wrong:
Standins no longer found in lfdirstate has *not* been removed -
they have probably just been deleted ... or not created.

This wrong reporting did that 'up -C' didn't undo the change and didn't sync
the two dirstates.

Instead of reporting such files as removed, propagate the deletion to the
standin file and report the file as deleted.
2016-10-17 17:12:24 +02:00
Mads Kiilerich
231fdaf8a2 largefiles: more safe handling of interruptions while updating modifications
Largefiles are fragile with the design where dirstate and lfdirstate must be
kept in sync.

To be less fragile, mark all clean largefiles as unsure ("normallookup") before
updating standins. After standins have been updated and we know exactly which
largefile standins actually was changed, mark the unchanged largefiles back to
clean ("normal").

This will make the failure mode more safe. If interrupted, the next command
will continue to perform extra hashing of all largefiles. That will do that all
largefiles that are out of sync with their standin will be marked dirty and
they will show up in status and can be cleaned with update --clean.
2016-10-16 02:29:45 +02:00
Mads Kiilerich
39f2a13215 util: increase filechunkiter size to 128k
util.filechunkiter has been using a chunk size of 64k for more than 10 years,
also in years where Moore's law still was a law. It is probably ok to bump it
now and perhaps get a slight win in some cases.

Also, largefiles have been using 128k for a long time. Specifying that size
multiple times (or forgetting to do it) seems a bit stupid. Decreasing it to
64k also seems unfortunate.

Thus, we will set the default chunksize to 128k and use the default everywhere.
2016-10-14 01:53:15 +02:00
Mads Kiilerich
f926541834 largefiles: always use filechunkiter when iterating files
Before, we would sometimes use the default iterator over large files. That
iterator is line based and would add extra buffering and use odd chunk sizes
which could give some overhead.

copyandhash can't just apply a filechunkiter as it sometimes is passed a
genuine generator when downloading remotely.
2016-10-12 12:22:18 +02:00
Danek Duvall
5572888746 color: add some documentation for custom terminfo codes 2016-10-15 15:01:14 -07:00
Danek Duvall
3d2001514d color: debugcolor should emit the user-defined colors
This also fixes a long-standing bug that reversed the sense of the color
name and the label used to print it, which was never relevant before.
2016-10-13 13:10:01 -07:00
Danek Duvall
36e57eb638 color: ignore effects missing from terminfo
If terminfo mode is in effect, and an effect is used which is missing from
the terminfo database, simply silently ignore the request, leaving the
output unaffected rather than causing a crash.
2016-10-13 12:01:41 -07:00
Danek Duvall
fb575a9782 color: allow for user-configurable terminfo codes for effects
If the entry in the terminfo database for your terminal is missing some
attributes, it should be possible to create them on the fly without
resorting to just making them a color.  This change allows you to have

    [color]
    terminfo.<effect> = <code>

where <effect> might be something like "dim" or "bold", and <code> is the
escape sequence that would otherwise have come from a call to tigetstr().
If an escape character is needed, use "\E".  Any such settings will
override attributes that are present in the terminfo database.
2016-10-13 11:48:17 -07:00
Pierre-Yves David
8f6b267699 eol: make sure we always release the wlock when writing cache
If any exception were to happen after we acquired the wlock, we could leave it
unreleased. We move the wlock release in a 'finally:' close as it should be.
2016-10-13 13:47:47 +02:00
Philippe Pepiot
fd197b867c record: return code from underlying commit 2016-10-12 12:22:54 +02:00
Mads Kiilerich
7afa73604d largefiles: use context for file closing
Make the code slightly smaller and safer (and more deeply indented).
2016-10-08 00:59:41 +02:00
Mads Kiilerich
73724460ec largefiles: when setting/clearing x bit on largefiles, don't change other bits
It is only the X bit that it matters to copy from the standin to the largefile
in the working directory. While it generally doesn't do any harm to copy the
whole mode, it is also "wrong" to copy more than the X bit we care about. It
can make a difference if someone should try to handle largefiles differently,
such as marking them read-only.

Thus, do similar to what utils.setflags does and set the X bit where there are
R bits and obey umask.
2016-10-08 00:59:40 +02:00
Mads Kiilerich
cb6727b739 eol: on update, only re-check files if filtering changed
Before, update would mark all files as 'normallookup' in dirstate if .hgeol
changed so all files would get the new filtering applied. That takes some time
... and is pointless if the filtering for that file didn't change.

Instead, keep track of the old filtering and only check files where the
filtering is changed.

To keep the old filtering, change to write the applied .hgeol content to
.hg/eol.cache instead of just touching it. That change is backwards/forwards
compatible.

In a real world test, this takes an update that is changing .hgeol and 30000
files from 12s to 4s - where the remaining eol overhead is 1-2s.
2016-10-09 15:54:49 +02:00
Mateusz Kwapich
f97c61b781 py3: use raw strings in line continuation (convert ext)
Our py2 to py3 string translations marks those as bytestrings.
2016-10-10 05:31:31 -07:00
Mateusz Kwapich
41dd071f2f py3: namedtuple takes unicode (journal ext)
namedtuple usage consistent with changelog.py:141
2016-10-10 05:30:14 -07:00
Mads Kiilerich
7fc89d4630 eol: store and reuse pattern matchers instead of creating in tight loop
More "right" and more efficient.
2016-10-09 15:54:42 +02:00
Mads Kiilerich
e84c500b99 eol: fix variable naming - call it _eolmatch instead of _eolfile
It is not the file but a match object based on it.
2016-10-09 15:42:42 +02:00
Kostia Balytskyi
c89c84d317 shelve: make --keep option survive user intervention (issue5431)
Currently if user runs 'hg unshelve --keep' and merge conflicts
occur, the information about --keep provided by user is lost and
shelf is deleted after 'hg unshelve --continue'. This is obviously
not desired, so this patch fixes it.
2016-11-23 14:58:52 -08:00
Pulkit Goyal
97f340e354 py3: use pycompat.getcwd() instead of os.getcwd()
We have pycompat.getcwd() which returns bytes path on Python 3. This patch
changes most of the occurences of the os.getcwd() with pycompat one.
2016-11-23 00:03:11 +05:30
Yuya Nishihara
30fe4722fb chgserver: make it a core module and drop extension flags
It was an extension just because there were several dependency cycles I
needed to address.

I don't add 'chgserver' to extensions._builtin since chgserver is considered
an internal extension so nobody should enable it by their config.
2016-10-15 14:30:16 +09:00
Yuya Nishihara
c55a1e0460 chgserver: delay importing commands and dispatch modules
This is a workaround for future import cycle: dispatch -> commands -> server
-> chgserver -> commands. Some of the problems can be fixed later on pager
and chg refactoring.
2016-10-15 14:37:18 +09:00
Yuya Nishihara
98cc069aeb chgserver: drop CHGINTERNALMARK by chgunixservice()
Prepares for the removal of uisetup(). We just need to do that at the start
of the chg server, so chgunixservice() should be fine.
2016-10-15 14:24:29 +09:00
Yuya Nishihara
e90ef2b652 server: move service table and factory from commandserver
This is necessary to solve future dependency cycle between commandserver.py
and chgserver.py.

'cmd' prefix is added to table and function names to avoid conflicts with
hgweb.
2016-10-15 13:57:17 +09:00
Augie Fackler
34a63fb4c6 rebase: refer to checkunresolved by its new name 2016-11-21 21:32:39 -05:00
Augie Fackler
85ea394346 rebase: refer to dirstateguard by its new name 2016-11-21 21:27:12 -05:00
Augie Fackler
6154ef8eaf mq: refer to dirstateguard by its new name 2016-11-21 21:05:52 -05:00
Augie Fackler
d3b8e6d277 dispatch: stop supporting non-use of @command
We said we'd delete this after 3.8. It's time.
2016-11-21 21:51:23 -05:00
Augie Fackler
ce63567c20 bugzilla: stop mentioning Pythons older than 2.6
We don't support those anyway.
2016-11-21 17:52:32 -05:00
Augie Fackler
049fe2f2ce win32mbcs: drop code that was catering to Python 2.3 and earlier 2016-11-21 17:48:13 -05:00
Yuya Nishihara
47f9c8b52e py3: bulk replace sys.stdin/out/err by util's
Almost all sys.stdin/out/err in hgext/ and mercurial/ are replaced by util's.
There are a few exceptions:

 - lsprof.py and statprof.py are untouched since they are a kind of vendor
   code and they never import mercurial modules right now.
 - ui._readline() needs to replace sys.stdin and stdout to pass them to
   raw_input(). We'll need another workaround here.
2016-10-20 23:53:36 +09:00
Gregory Szorc
2112fb0fd2 wireproto: perform chunking and compression at protocol layer (API)
Currently, the "streamres" response type is populated with a generator
of chunks with compression possibly already applied. This puts the onus
on commands to perform chunking and compression. Architecturally, I
think this is the wrong place to perform this work. I think commands
should say "here is the data" and the protocol layer should take care
of encoding the final bytes to put on the wire.

Additionally, upcoming commits will improve wire protocol support for
compression. Having a central place for performing compression in the
protocol transport layer will be easier than having to deal with
compression at the commands layer.

This commit refactors the "streamres" response type to accept either
a generator or an object with "read." Additionally, the type now
accepts a flag indicating whether the response is a "version 1
compressible" response. This basically identifies all commands
currently performing compression. I could have used a special type
for this, but a flag works just as well. The argument name
foreshadows the introduction of wire protocol changes, hence the "v1."

The code for chunking and compressing has been moved to the output
generation function for each protocol transport. Some code has been
inlined, resulting in the deletion of now unused methods.
2016-11-20 13:50:45 -08:00
Durham Goode
0f5c8089bc rebase: move bookmark update to before rebase clearing
Bookmark fixing should probably happen before the rebase starts to clean up, so
let's move it before clearrebased. This will also help a future patch where we
want to add more clear logic to the existing clear section.
2016-11-10 09:21:41 -08:00
Kostia Balytskyi
1e0814b20b shelve: move unshelve-finishing logic to a separate function
Finishing unshelve involves two steps now:
- stripping a changelog
- aborting a transaction
Obs-based shelve will not require these things, so isolating this logic
into a separate function where the normal/obs-shelve branching is
going to be implemented seems to be like a nice idea.

Behavior-wise this change moves 'unshelvecleanup' from being between
changelog stripping and transaction abortion to being after them.
I don't think this has any negative effects.
2016-11-11 07:01:27 -08:00
Kostia Balytskyi
ca69665116 shelve: move file-forgetting logic to a separate function
This is just a readability improvement.
2016-11-10 11:02:39 -08:00
Kostia Balytskyi
f2453996da shelve: move rebasing logic to a separate function
Rebasing restored shelved commit onto the right destination is done
differently in traditional and obs-based unshelve:
- for traditional, we just rebase it
- for obs-based, we need to check whether a successor of
  the restored commit already exists in the destination (this
  might happen when unshelving twice on the same destination)
This is the reason why this piece of logic should be in its own
function: to not have excessive complexity in the main function.
2016-11-10 10:57:10 -08:00
Kostia Balytskyi
634c961418 shelve: move commit restoration logic to a separate function 2016-11-10 10:51:06 -08:00
Kostia Balytskyi
6240b21e34 shelve: move temporary commit creation to a separate function
Committing working copy changes before rebasing a shelved commit
on top of them is an independent piece of behavior, which fits
into its own function.

Similar to the previous series, this and a couple of following
patches are for unshelve refactoring.
2016-11-13 03:35:52 -08:00
Pierre-Yves David
0d0d0a7af9 mq: release lock after transaction in qrefresh
The transaction should be closed within the lock.
2016-08-11 15:05:17 +02:00
Martin von Zweigbergk
cb58483f81 histedit: avoid converting nodeid to context and back again
It looks like this became unnecessary in 8166e7073157 (histedit: fix
preventing strips during histedit, 2015-04-04).
2016-09-27 22:09:28 -07:00
Xidorn Quan
a5b2da437e rebase: rebase changesets in topo order (issue5370) (BC)
There are two reasons that rebase should be done this way:
1. This would make rebasing faster because it would minimize the total
   number of files to be checked out in the process, as it don't need
   to switch back and forth between branches.
2. It makes resolving conflicts easier as user has a better context.

This commit changes the behavior in "Test multiple root handling" of
test-rebase-obsolete.t. It is an expected change which reflects the new
behavior that commits in a branch are grouped together when rebased.
2016-09-17 17:02:56 +10:00
timeless
04798f0fb8 histedit: use single quotes in use warning 2016-09-20 23:45:25 +00:00
timeless
8cd11bcddf keyword: use single quotes in use warning 2016-09-20 23:45:15 +00:00
timeless
80ebd8528d mq: use single quotes in use warning 2016-09-20 23:44:59 +00:00
timeless
64dce2c2d7 pager: use single quotes in use warning 2016-09-20 23:44:49 +00:00
timeless
1be7bec44c rebase: use single quotes in use warning 2016-09-20 23:44:28 +00:00
Durham Goode
769d2595c4 convert: move svn config initializer out of the module level
The svn_config_get_config config call was being called at the module level, but
had the potential to throw permission denied errors if ~/.subversion/servers was
not readable. This could happen in certain test environments where the user
permissions were very particular.

This prevented the remotenames extension from loading, since it imports
convert's hg module, which imports convert's subversion module, which calls
this. The config is only ever used from this one constructor, so let's just move
it in to there.
2016-08-01 17:38:01 -07:00
FUJIWARA Katsunori
7a8d36afcf doc: trim newline at the end of exception message 2016-08-01 06:08:25 +09:00
Christian Ebert
6e0f6b6bd8 keyword: avoid traceback when kwdemo is run outside a repo
68ae3063a47d causes a fatal AttributeError if kwdemo is run outside a repo
because in the temporary repo creation repo is None and therefore cannot have a
baseui attribute.
In this case fall back to using ui.

Add test case.
2016-07-27 13:57:51 +01:00
Matt Mackall
01b803db22 extdiff: escape path for docstring (issue5301)
The existing code (a) assumed path would be specified in
encoding.encoding and (b) assumed unicode() objects wouldn't cause
other parts of Mercurial to blow up. Both are dangerous assumptions.

Since we don't know the encoding of path and can't pass non-ASCII
through docstrings, just escape the path and drop the early _(). Will
have to suffice until we can teach docstrings to handle UTF-8b
escaping.

This has the side-effect that the line containing the path is now
variable by the time it reaches _() and thus can't be translated.
2016-07-18 16:25:35 -05:00
Kevin Bullock
99e7f64512 convert: update use of deprecated bzrlib property
The inventory property was deprecated in favor of root_inventory in bzr
2.5.0. Current version is 2.7.0.

I noticed this when testing locally on Python 2.6.9, which has warnings
turned on by default. The failure that occurs without this patch can be
seen on Python 2.7 by running with warnings enabled:

     $ PYTHONWARNINGS=::DeprecationWarning make 'test-convert-bzr*'
2016-07-19 11:00:32 -05:00
Simon Farnsworth
196af0f28e rebase: turn rebase revs into set before filtering obsolete
When the inhibit extension from mutable-history is enabled, it attempts to
iterate over the rebaseset to prevent the nodes being rebased from being
marked obsolete. This happens at the same time as rebase's
_filterobsoleterevs function trying to iterate over the rebaseset to figure
out which ones are obsolete. The two of these iterating over the same
revset generatorset cause a 'generator already executing' exception. This is
probably a flaw in the revset implementation, since iterating over the same
set twice should be supported.

This regression was introduced in 5d16ebe7b14, since it changed
_filterobsoleterevs to be called before the rebaseset was turned into a
set(). For now let’s just make the rebaseset an actual set again before
calling that function. This was caught by the inhibit tests.

The relevant call stack from test-inhibit.t:

   File "/tmp/hgtests.jgjrN5/install/lib/python/hgext/rebase.py", line 285, in _preparenewrebase
     obsrevs = _filterobsoleterevs(self.repo, rebaseset)
   File "/data/hgbuild/facebook-hg-rpms/mutable-history/hgext/inhibit.py", line 197, in _filterobsoleterevswrap
     r = orig(repo, rebasesetrevs, *args, **kwargs)
   File "/tmp/hgtests.jgjrN5/install/lib/python/hgext/rebase.py", line 1380, in _filterobsoleterevs
     return set(r for r in revs if repo[r].obsolete())
   File "/tmp/hgtests.jgjrN5/install/lib/python/hgext/rebase.py", line 1380, in <genexpr>
     return set(r for r in revs if repo[r].obsolete())
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3079, in _iterordered
     val2 = next(iter2)
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3417, in gen
     yield nextrev()
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3424, in _consumegen
     for item in self._gen:
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 71, in iterate
     cl = repo.changelog
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/repoview.py", line 319, in changelog
     revs = filterrevs(unfi, self.filtername)
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/repoview.py", line 261, in filterrevs
     repo.filteredrevcache[filtername] = func(repo.unfiltered())
   File "/data/hgbuild/facebook-hg-rpms/mutable-history/hgext/directaccess.py", line 65, in _computehidden
     hidden = repoview.filterrevs(repo, 'visible')
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/repoview.py", line 261, in filterrevs
     repo.filteredrevcache[filtername] = func(repo.unfiltered())
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/repoview.py", line 175, in computehidden
     hideable = hideablerevs(repo)
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/repoview.py", line 33, in hideablerevs
     return obsolete.getrevs(repo, 'obsolete')
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/obsolete.py", line 1097, in getrevs
     repo.obsstore.caches[name] = cachefuncs[name](repo)
   File "/data/hgbuild/facebook-hg-rpms/mutable-history/hgext/inhibit.py", line 255, in _computeobsoleteset
     if getrev(n) not in blacklist:
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3264, in __contains__
     return x in self._r1 or x in self._r2
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3348, in __contains__
     for l in self._consumegen():
   File "/tmp/hgtests.jgjrN5/install/lib/python/mercurial/revset.py", line 3424, in _consumegen
     for item in self._gen:
 ValueError: generator already executing
2016-07-19 03:29:53 -07:00
Yuya Nishihara
5cb7d27917 chgserver: rename private functions and variables of chgunixservicehandler
self.address has been reanmed to self._realaddress to clarify that it can
be different from the address argument.
2016-05-21 18:16:39 +09:00
Yuya Nishihara
73cb9f2e99 chgserver: refactor initialization of real/base addresses
Instead of overwriting self.address, calculate it from the address argument,
which is the base address.
2016-05-22 14:06:37 +09:00
Yuya Nishihara
fa171b462e chgserver: reorder functions in chgunixservicehandler
This should make it slightly easier to follow the call path.
2016-05-22 14:05:34 +09:00
Yuya Nishihara
9641a7ff4f chgserver: use ui.debug() to print server debug messages
commandserver.log() is noop at this time because no client connection is
established.
2016-05-21 18:15:20 +09:00
Yuya Nishihara
e51719b422 commandserver: unindent superfluous "if True" blocks 2016-05-21 18:14:13 +09:00
Kostia Balytskyi
847780e6fe rebase: remove sortedstate-related confusion
The following rebase implementation details are frustrating:
- storing a list of sorted revision numbers in a field named sortedstate
- having sortedstate be a field of the rebaseruntime class
- using sortedstate[-1] as opposed to a more intuitive max(self.state) to
  compute the latest revision in the state

This commit fixes those imperfections.
2016-07-14 03:12:09 -07:00
Kostia Balytskyi
1c4ad1d1d3 rebase: replace extrafn field with _makeextrafn invocations
As per Yuya's advice, we would like to slightly reduce the amount of state
which is stored in rebaseruntime class. In this case, we don't need to store
extrafn field, as we can produce the necessary value by calling _makeextrafn
and the perf overhead is negligible.
2016-07-14 02:59:27 -07:00
Yuya Nishihara
cbf8b420cf chgserver: switch to new forking service
Threading and complex classes are no longer necessary. _autoexitloop() has
been replaced by polling cycle in the main thread.
2016-05-22 13:36:37 +09:00
Yuya Nishihara
ad9977e54c chgserver: extract stub factory of service object
The class inheritance will be replaced by composition. See the next patch
for details.
2016-05-22 13:13:04 +09:00
Yuya Nishihara
692e073582 chgserver: reorder service classes to make future patches readable
Includes no functional change.
2016-05-22 13:08:30 +09:00
Yuya Nishihara
d298dc2539 commandserver: extract function that serves for the current connection
This will be used by new server implementation.
2016-05-22 12:49:22 +09:00
Yuya Nishihara
be6319726b commandserver: manually create file objects from socket
Prepares for moving away from SocketServer. See the subsequent patches for
why.
2016-05-22 12:44:25 +09:00
Kostia Balytskyi
e27abece5f shelve: make unshelve be able to abort in any case 2016-07-13 16:16:18 +01:00
Yuya Nishihara
53e19881da commandserver: extract _cleanup() hook to clarify chg is doing differently
This makes it clear that chg needs its own way to unlink closed socket file.
I made a mistake in draft patches without noting the difference.
2016-05-22 11:21:11 +09:00
Yuya Nishihara
278af8b465 chgserver: drop repo at chgunixservice.__init__()
Since it isn't expensive operation, we don't have to delay it to init().
2016-05-21 17:06:39 +09:00
Yuya Nishihara
9531323bdb chgserver: extract utility to bind unix domain socket to long path
This is common problem of using sockaddr_un.
2016-05-21 16:52:04 +09:00
Yuya Nishihara
e524ae5976 chgserver: narrow scope of chdir() to socket.bind()
This helps extracting a utility function.
2016-05-21 16:42:59 +09:00
Yuya Nishihara
bfbe03d5c2 commandserver: backport handling of forking server from chgserver
This is common between chg and vanilla forking server, so move it to
commandserver and unify handle().

It would be debatable whether we really need gc.collect() or not, but that
is beyond the scope of this series. Maybe we can remove gc.collect() once
all resource deallocations are switched to context manager.
2016-05-21 15:23:21 +09:00
Yuya Nishihara
b7be4fa70f commandserver: promote .cleanup() hook from chgserver
This allows us to unify _requesthandler.handle().
2016-05-21 15:18:23 +09:00
Yuya Nishihara
3f1513d0b9 commandserver: extract method to create commandserver instance per request
This is a step toward merging chgserver._requesthandler with commandserver's.
2016-05-21 15:12:19 +09:00
Durham Goode
3d4a2a798a share: don't recreate the source repo each time
Previously, every time you asked for the source repo of a shared working copy it
would recreate the repo object, which required calling reposetup. With certain
extension enabled, this can be quite expensive, and it can happen many times
(for instance, share attaches a post transaction hook to update bookmarks that
triggers this).

The fix is to just cache the repo object instead of constantly recreating it.
2016-07-11 13:40:02 -07:00
Martijn Pieters
70f47c8885 journal: add support for seaching by pattern
If a pattern is used, include the entry name in the output, to make it clear
what name was matched.
2016-07-08 16:48:38 +01:00
Martijn Pieters
a0e514f821 journal: add share extension support
Rather than put everything into one journal file, split entries up in *shared*
and *local* entries. Working copy changes are local to a specific working copy,
so should remain local only. Other entries are shared with the source if so
configured when the share was created.

When unsharing, any shared journale entries are copied across.
2016-07-11 14:45:41 +01:00
Martijn Pieters
c699263458 journal: add dirstate tracking
Note that now the default action for `hg journal` is to list the working copy
history, not all bookmarks. In its place is the `--all` switch which lists all
name changes recorded, including the name for which the change was recorded on
each line.

Locking is switched to using a dedicated lock to avoid issues with the dirstate
being written during wlock unlocking (you can't re-lock during that process).
2016-07-11 13:39:24 +01:00
Pulkit Goyal
aef2bdd39a py3: make files use absolute_import and print_function
This patch includes addition of absolute_import and print_function to the
 files where they are missing. The modern importing conventions are also followed.
2016-07-03 22:28:24 +05:30
Kostia Balytskyi
a6f612e44f rebase: move handling of obsolete commits to be a separate RR class method 2016-07-01 14:09:53 +02:00
Kostia Balytskyi
c56035ebe4 rebase: move rebase finish logic to be a method of the RR class
Rebase finish logic includes collapsing working directorystate into
a single commit, moving bookmarks, clearing status and collapsemsg files,
reporting skipped commits to the user and obsoleting precursors of the
newly created commits.
2016-07-01 14:09:53 +02:00
Kostia Balytskyi
aa32920473 rebase: move core rebase logic to be a method of the RR class 2016-07-01 14:09:53 +02:00
Kostia Balytskyi
5b06bb7da5 rebase: move local variable 'extrafn' to the RR class 2016-07-01 14:09:53 +02:00
Kostia Balytskyi
ae0baad3c5 rebase: move local variable 'currentbookmarks' to the RR class 2016-07-01 14:09:53 +02:00
Kostia Balytskyi
f2b722d727 rebase: make collapsing use explicit logic to decide on the rev to reuse
This code:

    for rev in sortedstate:
        ...
    ...
    newnode = concludenode(repo, rev, p1, rbsrt.external,
                           commitmsg=commitmsg,
                           extrafn=extrafn, editor=editor,
                           keepbranches=rbsrt.keepbranchesf,
                           date=rbsrt.date)

uses 'rev' variable in 'concludenode' function invocation. It is not
explicitly assigned before, but its value comes as last value or 'rev' in
a for loop, e.g. last element in a 'sortedstate'. IMO this a bad style and it
also makes it hard to refactor the function, so it is better to explicitly
define the value passed to 'concludenode'.
2016-07-01 14:09:53 +02:00
Kostia Balytskyi
936c3aec9f rebase: move new rebase preparation to be a method of the RR class
This commit moves logic that prepares the execution of a new rebase
operation to be a method of the rebaseruntime class.
2016-07-01 14:09:53 +02:00
Kostia Balytskyi
0946a3aa1d rebase: move abort/continue prep to be a method of the RR class
This commit moves logic that prepares the execution of abort and
continue phases or rebase operation to be a method of the rebaseruntime
class.
2016-07-01 14:09:53 +02:00
Sean Farley
bae0386e22 histedit: move autoverb rule to the commit it matches
Inspired by how 'git rebase -i' works, we move the autoverb to the
commit line summary that it matches. We do this by iterating over all
rules and inserting each non-autoverb line into a key in an ordered
dictionary. If we find an autoverb line later, we then search for the
matching key and append it to the list (which is the value of each key
in the dictionary). If we can't find a previous line to move to, then we
leave the rule in the same spot.

Tests have been updated but the diff looks a little messy because we
need to change one of the summary lines so that it will actually move to
a new spot. On top of that, we added -q flags to future some of the
output and needed to change the file it modified so that it wouldn't
cause a conflict.
2016-06-21 14:58:49 -07:00
Sean Farley
f5c99064dd histedit: use _getsummary in ruleeditor
This patch uses our common method instead of duplicating logic.
2016-05-27 14:03:00 -07:00
Sean Farley
0aadad3fdc histedit: use _getsummary in torule
This patch uses our common method instead of duplicating logic.
2016-05-27 14:02:36 -07:00
Sean Farley
2a852d9312 histedit: extract common summary code into method
We're going to need to use this code in our autoverb logic so let's
extract it now and save ourselves from code duplication.
2016-05-27 14:00:12 -07:00
Sean Farley
a8452be140 histedit: remove unneeded initial parameter
Now that the autoverb logic no longer acts on an individual rule line,
we don't need this parameter since we apply our logic just once at the
time of initialization.
2016-05-26 15:43:00 -07:00
Sean Farley
60d7ad0f37 histedit: move autoverb logic from torule to ruleeditor
This is needed for an upcoming change that will automatically rearrange the
rules based on the commit message. Before this patch, the autoverb logic only
applied to one rule at a time. This moves that logic one step up so that it can
iterate over all the rules and rearrange as needed.
2016-05-26 16:46:10 -07:00
Jun Wu
033b57c8df logtoprocess: do not leak the ui object in uisetup
logtoprocess.log should use "self" passed in function arguments instead
of the "ui" object from outside the function.
2016-06-30 15:26:11 +01:00
Jun Wu
35f0266cea chgserver: document why we don't merge mtimehash and confighash
People may get confused about chg's mtimehash and confighash design: why two
hashes instead of just one. This patch adds text addressing the concern.
2016-06-29 23:53:20 +01:00
Martijn Pieters
5eddc7a7b3 journal: new experimental extension
Records bookmark locations and shows you where bookmarks were located in the
past.

This is the first in a planned series of locations to be recorded; a future
patch will add working copy (dirstate) tracking, and remote bookmarks will be
supported as well, so the journal storage format should be fairly generic to
support those use-cases.
2016-06-24 16:12:05 +01:00
Pulkit Goyal
38a359ce5c py3: conditionalize SocketServer import
The SocketServer is renamed to socketserver in python 3
2016-06-27 16:48:54 +05:30
Pulkit Goyal
fdc0861e35 py3: conditionalize xmlrpclib import
The xmlrpclib library is renamed to xmlrpc.client in python 3
2016-06-27 16:37:37 +05:30
Pulkit Goyal
5fcc6a2628 py3: conditionalize the urlparse import
The urlparse library is renamed to urllib.parse in python 3
2016-06-27 16:16:10 +05:30
Jun Wu
9579ecf5f2 chgserver: do not ignore SIGPIPE if pager is used
We rely on SIGPIPE to exit when the pager exits. And Python ignores SIGPIPE
by default. Explicitly set SIGPIPE handler to SIG_DFL (terminate) just like
pager.py.
2016-06-24 17:06:41 +01:00
Martijn Pieters
a8afdea978 share: move magic string to a constant 2016-06-24 10:32:38 +01:00
Martin von Zweigbergk
a0ebc57925 rebase: make debug logging more consistent
We emit some lines that mix revision numbers with nodeids, which makes
little sense to me.
2016-09-13 13:49:42 -07:00
liscju
347bb0767e largefiles: check file in the repo store before checking remotely (issue5257)
Problem was files to check were gathered in the repository where
the verify was launched but verification was done on the remote
store. It was observed when user committed in cloned repository
and ran verify before pushing - committed files were marked
as non existing.

This commit fixes this by checking in the remote store only files
that are not existing in the repository store where verify was launched.

Solution is similiar to 909b9d8f9ae7
2016-06-23 22:37:17 +02:00
liscju
36f41df99d largefiles: remove additional blank lines
It does not conform to the coding style.
2016-06-27 10:33:33 +02:00
liscju
a37f11d3d7 largefiles: fix misleading comments in lfutil instore and storepath
Problem in both cases is cache in largefiles has assigned
meaning - user cache which is additional place to get/put
files. Those two function works on store - the main place
to store largefiles in the repository - .hg/largefiles and
using "cache" to describe it is misleading.
2016-06-24 09:08:16 +02:00
liscju
7e9f22c475 largefiles: remove additional blank line between methods in localstore
According to the coding style it should be a single blank line
between functions.
2016-06-24 11:51:00 +02:00
Kostia Balytskyi
a7adcda5dc rebase: move local variable 'obsoletenotrebased' to the RR class 2016-06-21 06:29:23 -07:00
Kostia Balytskyi
c0f90a3ffa rebase: move restorestestatus function to be a method of the RR class 2016-06-21 06:29:23 -07:00
Kostia Balytskyi
b5102baa59 rebase: move local variables related to keeping things unchanged to the RR
This commit moves the following variables, local to the rebase function to be
fields of the rebaseruntime:
 -keepf
 -keepbranchesf
 -keepopen
2016-06-21 06:29:23 -07:00
Kostia Balytskyi
7ea5cc73ed rebase: move local variables 'date' and 'extrafns' to the RR class
This commit moves the following variables, local to the rebase function to be
fields of the rebaseruntime:
 -date
 -extrafns
2016-06-21 06:29:23 -07:00
Kostia Balytskyi
66b3ef340b rebase: move collapse-related local variables to the RR class
This commit moves the following variables local to the 'rebase' function
to be fields of the rebaseruntime class:
 -collapsef
 -collapsemsg
2016-06-21 06:29:23 -07:00
Kostia Balytskyi
d75ec97b9b rebase: pass repo, ui and opts objects to the RR class constructor 2016-06-21 07:22:49 -07:00
FUJIWARA Katsunori
f46b49a0e3 check-code: detect "missing _() in ui message" more exactly
Before this patch, "missing _() in ui message" rule overlooks
translatable message, which starts with other than alphabet.

To detect "missing _() in ui message" more exactly, this patch
improves the regexp with assumptions below.

  - sequence consisting of below might precede "translatable message"
    in same string token

    - formatting string, which starts with '%'
    - escaped character, which starts with 'b' (as replacement of '\\'), or
    - characters other than '%', 'b' and 'x' (as replacement of alphabet)

  - any string tokens might precede a string token, which contains
    "translatable message"

This patch builds an input file, which is used to examine "missing _()
in ui message" detection, before '"$check_code" stringjoin.py' in
test-contrib-check-code.t, because this reduces amount of change churn
in subsequent patch.

This patch also applies "()" instead of "_()" on messages below to
hide false-positives:

  - messages for ui.debug() or debug commands/tools
    - contrib/debugshell.py
    - hgext/win32mbcs.py (ui.write() is used, though)
    - mercurial/commands.py
      - _debugchangegroup
      - debugindex
      - debuglocks
      - debugrevlog
      - debugrevspec
      - debugtemplate

  - untranslatable messages
    - doc/gendoc.py (ReST specific text)
    - hgext/hgk.py (permission string)
    - hgext/keyword.py (text written into configuration file)
    - mercurial/cmdutil.py (formatting strings for JSON)
2016-06-21 00:50:39 +09:00
liscju
caed6f4913 url: extract password database from password manager
So far password manager was keeping authentication information so opening
new connection and creating new password manager made all saved authentication
information lost.

This commit separates password manager and password database to make it
possible to reuse saved authentication information.

This commit violates code checker because it adds add_password method (name
with underscore) to passwordmgr object to provide method required by urllib2.
2016-06-05 23:36:23 +02:00
Kostia Balytskyi
305d79a43c rebase: do not abort if all changesets have equivalents in the destination 2016-06-17 16:59:08 +01:00
Kostia Balytskyi
82f69b2833 rebase: move local variable 'targetancestors' to the RR class 2016-06-13 22:41:45 +01:00
Kostia Balytskyi
e83111af7f rebase: move local variable 'skipped' to the RR class 2016-06-13 22:40:59 +01:00
Kostia Balytskyi
648a368d05 rebase: move local variable 'target' to the RR class 2016-06-13 22:38:54 +01:00
Kostia Balytskyi
e11f6bcd12 rebase: introduce a rebaseruntime (RR) class
rebaseruntime is a class that will in future contain all of the state
necessary to perform rebase operation and have pieces of rebase logic as
its methods.

This commit introduces the class and moves the following local variables to
be its fields:
- originalwd
- external
- state
- activebookmark
2016-06-13 22:36:13 +01:00
liscju
1d5b38f7bf largefiles: make storefactory._openstore public
In storefactory opening store is the main functionality,
so it shouldn't be marked as private with underscore.
2016-06-14 11:21:41 +02:00
Matt Mackall
3eee63391d merge with stable 2016-06-14 14:52:58 -05:00
Augie Fackler
ad67b99d20 cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1
All versions of Python we support or hope to support make the hash
functions available in the same way under the same name, so we may as
well drop the util forwards.
2016-06-10 00:12:33 -04:00
Henrik Stuart
5de4cefa8f largefiles: fix support for local largefiles while using share extension
Prior to revision 149be6a0072e, largefiles were saved in the local repository,
even if it was using the share extension. After that change, all largefiles are
now stored in the shared repository. However, the backward compatibility for
existing largefiles already placed in the local repository was never tested,
and has been broken since.
2016-06-07 08:32:33 +02:00
Pulkit Goyal
5f52c722cf py3: conditionalize cPickle import by adding in util
The cPickle is renamed to _pickle in python3 and this C extension is available
 in pickle which was not included in earlier versions. So imports are conditionalized
 to import cPickle in py2 and pickle in py3. Moreover the use of pickle in py2 is
 switched to cPickle as the C extension is faster. The hack is added in util.py and
the modules import util.pickle
2016-06-04 14:38:00 +05:30
liscju
934bafbfb7 largefiles: rename match_ to matchmod import in lfutil 2016-05-20 01:42:04 +02:00
liscju
7467d15811 largefiles: rename match_ to matchmod import in reposetup 2016-05-12 11:49:23 +02:00
liscju
fb39d8bea4 largefiles: rename match_ to matchmod import in overrides 2016-05-12 11:48:39 +02:00
liscju
fb266ed15a largefiles: rename match_ to matchmod import in lfcommands 2016-05-12 11:36:51 +02:00
liscju
4242fcbf91 py3: make largefiles/wirestore.py use absolute_import 2016-05-10 15:20:04 +02:00
liscju
6e333c2c20 py3: make largefiles/uisetup.py use absolute_import 2016-05-10 15:14:41 +02:00
liscju
38919bdfd2 py3: make largefiles/reposetup.py use absolute_import 2016-05-10 15:04:22 +02:00
liscju
616103a23f py3: make largefiles/remotestore.py use absolute_import 2016-05-10 15:00:22 +02:00
liscju
98325536ee py3: make largefiles/proto.py use absolute_import 2016-05-10 14:41:58 +02:00
liscju
e5e8e7152a py3: make largefiles/overrides.py use absolute_import 2016-05-10 14:26:36 +02:00
liscju
3b9e08b77b py3: make largefiles/localstore.py use absolute_import 2016-05-10 14:20:51 +02:00
liscju
835eadbfd6 py3: make largefiles/lfutil.py use absolute_import 2016-05-10 15:09:22 +02:00
liscju
37b813e4a9 py3: make largefiles/lfcommands.py use absolute_import 2016-05-07 15:44:46 +02:00
liscju
d3eea62c87 py3: make largefiles/basestore.py use absolute_import 2016-05-06 14:30:23 +02:00
liscju
41cd14dafa py3: make largefiles/__init__.py use absolute_import 2016-05-06 14:28:32 +02:00
liscju
d655e60e3c largefiles: move basestore._openstore into new module to remove cycle 2016-06-04 16:53:44 +02:00
Gregory Szorc
35166670e2 mail: unsupport smtp.verifycert (BC)
smtp.verifycert was accidentally broken by 799db3fe9866. And,
I believe the "loose" value has been broken for longer than that.
The current code refuses to talk to a remote server unless the
CA is trusted or the fingerprint is validated. In other words,
we lost the ability for smtp.verifycert to lower/disable security.

There are special considerations for smtp.verifycert in
sslutil.validatesocket() (the "strict" argument). This violates
the direction sslutil is evolving towards, which has all security
options determined at wrapsocket() time and a unified code path and
configs for determining security options.

Since smtp.verifycert is broken and since we'll soon have new
security defaults and new mechanisms for controlling host security,
this patch formally deprecates smtp.verifycert. With this patch,
the socket security code in mail.py now effectively mirrors code
in url.py and other places we're doing socket security.

For the record, removing smtp.verifycert because it was accidentally
broken is a poor excuse to remove it. However, I would have done this
anyway because smtp.verifycert is a one-off likely used by few people
(users of the patchbomb extension) and I don't think the existence
of this seldom-used one-off in security code can be justified,
especially when you consider that better mechanisms are right around
the corner.
2016-06-04 11:13:28 -07: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
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
Mateusz Kwapich
717823e3f5 shelve: use backup functions instead of manually copying dirstate
This increases encapsulation of dirstate: the dirstate file is private
to the dirstate module and shouldn't be touched by extensions directly.
2016-05-24 13:29:53 -07:00
FUJIWARA Katsunori
04f80329bc notify: make a message translatable
This message has been overlooked by check-code, because it starts with
non-alphabet character ('\').

Making this message translatable seems reasonable, because messages
below in same function are already translatable

  - '\ndiffs (truncated from %d to %d lines):\n\n'
  - '\ndiffs (%d lines):\n\n'

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.
2016-05-26 01:57:34 +09:00
FUJIWARA Katsunori
79a0468939 gpg: make a message translatable
This message has been overlooked by check-code, because it starts with
non-alphabet character ('%').

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.
2016-05-26 01:57:34 +09:00
Gregory Szorc
1ddd445f21 purge: use opts.get()
Most commands use opts.get() to retrieve values for options
that may not be explicitly passed. purge wasn't.

This makes it easier to call purge() from 3rd party extensions.
2016-05-16 14:21:39 -07:00
liscju
a5a56dc8d5 largefiles: send statlfile remote calls only for nonexisting locally files
Files that are already in local store should be checked locally. The problem
with this implementation is how difference in messages between local and remote
checks should look like. For now local errors for file missing and content
corrupted looks like this:

'changeset cset: filename references missing storepath\n'
'changeset cset: filename references corrupted storepath\n'

for remote it looks like:

'changeset cset: filename missing\n'
'changeset cset: filename: contents differ\n'

Contents differ error for remote calls is never raised currently - for now
statlfile implementation lacks checking file content.
2016-05-09 10:05:32 +02:00
timeless
a1cb3173a2 py3: convert to next() function
next(..) was introduced in py2.6 and .next() is not available in py3

https://docs.python.org/2/library/functions.html#next
2016-05-16 21:30:53 +00:00
Sean Farley
a69dcd1771 histedit: add experimental config for using the first word of the commit
This allows users to start a commit with "verb! ..." so that when this is
opened in histedit, the default action will be "verb". For example, "roll! foo"
will default to the action "roll". Currently, we'll allow any known verb to be
used but this is experimental.
2016-05-06 18:12:36 -07:00
Sean Farley
6348f9426e histedit: add optional parameter for determining intial editor line
A simple refactor to allow us to change the default verb for the initial editor
display.
2016-05-06 18:00:03 -07:00
Yuya Nishihara
a5c934df3c py3: move up symbol imports to enforce import-checker rules
Since (b) is banned, we should do the same for (a) for consistency.

 a) from mercurial import hg
    from mercurial.i18n import _

 b) from . import hg
    from .i18n import _
2016-05-14 14:03:12 +09:00
Jun Wu
1c8f26818c hgcia: remove hgcia (BC)
As discussed at:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-March/081018.html,
cia service is down for years. It also uses socket.setdefaulttimeout() which
will break chg. This patch removes the extension.
2016-05-12 01:03:19 +01:00
Pulkit Goyal
58d8791d2b py3: make hgext/rebase.py use absolute_import 2016-05-06 22:21:32 +05:30
Pulkit Goyal
336149484f py3: make hgext/mq.py use absolute_import 2016-05-06 21:54:31 +05:30
Pulkit Goyal
8d03cfe483 py3: make hgext/hisedit.py use absolute_import 2016-05-06 21:52:26 +05:30
Pulkit Goyal
770fabee34 py3: make hgext/hgk.py use absolute_import 2016-05-06 21:50:40 +05:30
Pulkit Goyal
21822d329b py3: make hgext/gpg.py use absolute_import 2016-05-06 21:46:17 +05:30
Pulkit Goyal
c83d2f743d py3: make hgext/graphlog.py use absolute_import 2016-05-06 21:48:17 +05:30
Pulkit Goyal
5d5b487562 py3: make hgext/fetch.py use absolute_import 2016-05-06 21:44:41 +05:30
Jun Wu
1de5a3a533 chgserver: add [alias] to confighash
The [alias] config section affects a global state: commands.table. It's hard
to trace whether an alias is added by a config option or an extension, and
add/remove aliases in a safe way per chg request. It will hurt performance a
bit if we clean the table and parse aliases every time. Therefore let's just
add it to confighash.

This will make chg pass test-pager.t.
2016-05-07 14:51:32 +01:00
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
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