Commit Graph

35004 Commits

Author SHA1 Message Date
Matt Harbison
258062fa5b status: update the help to indicate that clean files are not normally tersed
The same applies to '?' if --quiet is used (or any of the other states if some
of -marduic is specified), but I couldn't figure out how to express that
clearly.
2017-10-28 00:00:05 -04:00
Matt Harbison
9eb4def389 terse: split on repo separator instead of os.sep (issue5715)
The paths being processed are from scmutil.status, and therefore normalized to
'/' separators.
2017-10-27 23:48:38 -04:00
Anton Shestakov
baa04128f5 makefile: put format-c into .PHONY targets 2017-10-26 11:58:55 +08:00
Yuya Nishihara
73e9f96212 statichttprepo: prevent loading dirstate over HTTP on node lookup (issue5717)
This seems a bit hacky, but works well. There should be no reason that
static-http repo had to load dirstate.

Initially I tried to proxy os.stat() call through vfs so that statichttpvfs
could hook it, but there wasn't a good error value which the statichttpvfs
could return to get around the util.filestat issue.
2017-10-25 21:58:03 +09:00
Yuya Nishihara
e368124f71 test-static-http: show all files accessed over HTTP
This provides some confidence on files that should be loadable over HTTP.
Hopefully it will prevent future bugs.
2017-10-25 21:21:42 +09:00
Yuya Nishihara
86972fbe07 server: drop executable bit from daemon log file
The logfile option was unused, so it was okay until now.
2017-10-25 21:20:01 +09:00
Kevin Bullock
6264723128 setup: filter out devel-warn messages from system hg
If we're going to use the user's installed and configured hg command
(which we do since a4a6cb293e63), we should prevent devel-warn messages
from interfering with locating it.
2017-10-23 22:13:59 -05:00
Kevin Bullock
1a166f93b9 setup: remove duplicate assignment of HGRCPATH
HGRCPATH is already set in localhgenv().
2017-10-23 21:30:59 -05:00
Kevin Bullock
4073f3374c packaging: update book URL in Mac and Windows READMEs 2017-10-20 13:54:51 -05:00
muxator
aaf12eb558 commands: be more uniform in an "hg update" error message
"can only specify one of -C/--clean, -c/--check, or -m/merge"
becomes
"can only specify one of -C/--clean, -c/--check, or -m/--merge"
2017-10-23 22:45:24 +02:00
muxator
571ba67b50 update: mention long options explicitly in description of merge.update()
The short options "-c" and "-C" may be confusing for a novice reading the
documentation. Let's try to be more explicit, also mentioning the equivalent
long options ("--check" and "--clean") in the comments.
2017-10-04 23:22:34 +02:00
Yuya Nishihara
feaa3f8a8c mq: copy pager attributes back to qrepo.ui
If the legacy pager extension is enabled, a pager is started through repo.ui
at dispatch._runcommand(). After that, mqcommand() creates a qrepo with a
fresh repo.baseui, at which point pager information was lost and another pager
would be spawned by the modern pager interface.

This is a minimal workaround for the problem.
2017-10-21 13:42:43 +09:00
Yuya Nishihara
9e02f75b4c registrar: host "dynamicdefault" constant by configitem object
This is the common pattern seen in the other registrar classes.
2017-10-21 13:13:20 +09:00
Yuya Nishihara
74c1bd2363 configitems: register 'ui.editor' 2017-10-21 13:04:58 +09:00
Pulkit Goyal
db8a9589fd remotenames: add functions to read remotenames data from .hg/remotenames/
This patch functions which can be used to read remotenames data from
.hg/remotenames/. The logic for the function which reads the remotenames file is
taken from the remotenames extension.

Previously reviewed as D940.

Differential Revision: https://phab.mercurial-scm.org/D1550
2017-10-05 01:31:53 +05:30
Pulkit Goyal
1ca9372e4c remotenames: add test showing overwriting on remotenames data
The current storage logic every time overwrites the existing data with the new
data. This patch adds test to demonstrate that. To fix this, we need to add
logic to read existing remotenames data and merge with existing data which will
be added in upcoming changesets.

Previously reviewed as D1356.

Differential Revision: https://phab.mercurial-scm.org/D1549
2017-11-10 22:54:59 +05:30
Pulkit Goyal
d680032136 remotenames: add functionality to store remotenames under .hg/hgremotenames/
This patch moves the functionality from remotenames extension to store
remotenames to core.

Storage format used by remotenames extension:

A single file `.hg/remotenames` with an entry in each line where each line is of
format:
`node nametype remotepath/name`
where nametype is either 'bookmarks' or 'branches'.

This was not the best way to store data, so while moving to core the storage
format was changed but yet not the final format. The storage format used by core
after this patch will be:

* A file for each type of name i.e. bookmarks and branches in .hg/remotenames/
  directory
* A version number on the top of the file. The version for current format is 0.
* An entry in each line where each line is of the format
`node\0remotepath\0name`

The logic to sync with existing remotenames file and saving journals and other
related things will be moved to core in next patches incrementally.

Thanks to Ryan, Augie and Durham for suggestions on storage format.

Previously reviewed as D939.

Differential Revision: https://phab.mercurial-scm.org/D1548
2017-10-05 00:44:38 +05:30
Pulkit Goyal
c2ca736b6e remotenames: move function to pull remotenames from the remoterepo to core
This patch is the first patch of the series moving functionality from
hgremotenames extension to core.

There are lot of functionality in the extension which in the end enables us to
store branch heads and bookmarks location on a server from which we are pulling
or cloning from. This will help us in creating a better bookmark workflow where
we can show user that a certain server has this bookmarks at this node. It will
also introduce namespaces related to remote bookmarks and remote branches.

This patch moves the functionality to pull branches and bookmarks from a
server from which we are pulling to core behind config option
`experimental.remotenames`.

This patch adds a test which helps us to analyse whether things are working or
not. We are currently writing things to ui, we will write information to files
in upcoming patches.

Previously reviewed as D937.

Differential Revision: https://phab.mercurial-scm.org/D1547
2017-10-05 00:02:02 +05:30
Boris Feld
f68fdd45d6 test: fix bad replace for fixing pure-only build
When we replaced the patterns, glob was removed on the fixed line, it was a
mistake and caused the pure-only build to fails.

Differential Revision: https://phab.mercurial-scm.org/D1592
2017-12-05 19:06:46 +01:00
Boris Feld
f12384139a test: fix common-pattern for pure variant
The $USUAL_COMPRESSIONS$ value that was taken was not compatible with the pure
variant systems as zlib seems to not be available in these case.

Differential Revision: https://phab.mercurial-scm.org/D1562
2017-11-29 23:20:52 -05:00
Matt Harbison
26d7de6319 tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
I suspect some more of these are globbed out, so this is a bit of future
proofing.
2017-12-02 20:03:28 -05:00
Matt Harbison
aae64c603b tests: add a substitution for ECONNRESET/WSAECONNRESET messages 2017-12-02 20:10:58 -05:00
Matt Harbison
d0fab5d188 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages 2017-12-02 20:38:23 -05:00
Matt Harbison
d2dab77cb0 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Automatic replacement seems better than trying to figure out a check-code rule.
I didn't bother looking to see why the error message and file name is reversed
in the annotate and histedit tests, based on Windows or not.

I originally had this as a list of tuples, conditional on the platform.  But
there are a couple of 'No such file or directory' messages emitted by Mercurial
itself, so unconditional is required for stability.  There are also several
variants of what I assume is 'connection refused' and 'unknown host' in
test-clone.t and test-clonebundles.t for Docker, FreeBSD jails, etc.  Yes, these
are handled by (re) tags, but maybe it would be better to capture those strings
in order to avoid whack-a-mole in future tests.  All of this points to using a
dictionary containing one or more strings-to-be-replaced values.
2017-12-02 19:33:34 -05:00
Gregory Szorc
32f7e24bb4 setup: only write some autogenerated files if they change
Without this change, setup.py always writes some files on every
invocation. This prevents some builds from being a no-op when they
should. And, since times can sneak into generated .pyc files,
this prevents file content from being deterministic between
builds.

As part of the refactor, we treat file content as bytes.

The only potential regression from this would be if some tool
is looking at mtimes of the changed files to determine if
further action should be taken. But I don't think anything
critically important is keyed off the mtimes of these specific files.

Differential Revision: https://phab.mercurial-scm.org/D1580
2017-12-03 20:55:35 -08:00
Augie Fackler
35d780eef2 python3: whitelist many more passing tests
Differential Revision: https://phab.mercurial-scm.org/D1584
2017-12-04 15:30:30 -05:00
Yuya Nishihara
9bf6236a83 fancyopts: fix handling of "--" value in earlygetopt() 2017-11-25 17:30:50 +09:00
Yuya Nishihara
502549c773 fancyopts: use getopt.gnu_getopt()
The issue described in the docstring has been fixed since Python 20ab2260dc93,
which is in 2.7.

https://hg.python.org/cpython/rev/20ab2260dc93
https://bugs.python.org/issue4458

This fixes the handling of '--' value.
2017-11-24 01:09:00 +09:00
Yuya Nishihara
86043c7487 dispatch: replace _earlygetopt(strip=True) with new parser
The execution order in cmdalias.__init__() is adjusted to set stripped args
to self.givenargs, which is no longer updated in place.
2017-11-23 23:18:56 +09:00
Yuya Nishihara
c2c866a852 dispatch: replace _earlyreq*() with new fancyopts-based parser 2017-11-23 22:23:59 +09:00
Yuya Nishihara
2e53122de6 dispatch: alias --repo to --repository while parsing early options
This prepares for replacing old _early*opt() functions. My initial attempt
was to extend options table to support 'repository|repo' syntax. It worked,
but seemed too invasive. So I decided to add an optional argument to
fancyopts() instead.

This also changes the nevernegate dict to be keyed by a canonical_name,
not by an option-name for clarity.
2017-11-25 17:03:52 +09:00
Anton Shestakov
7187e609f7 spartan: render changesets server-side on /graph page 2017-12-04 19:08:41 +08:00
Anton Shestakov
7a357f1cf9 monoblue: render changesets server-side on /graph page 2017-12-04 18:26:54 +08:00
Anton Shestakov
55006fdcc2 gitweb: render changesets server-side on /graph page 2017-12-04 17:43:45 +08:00
Anton Shestakov
3c2de0ad20 paper: render changesets server-side on /graph page 2017-12-04 16:21:15 +08:00
Anton Shestakov
364b5723c5 hgweb: only include graph-related data in jsdata variable on /graph pages (BC)
Historically, client-side graph code was not only rendering the graph itself,
but it was also adding all of the changeset information to the page as well.
It meant that JavaScript code needed to construct valid HTML as a string
(although proper escaping was done server-side). It wasn't too clunky, even
though it meant that a lot of server-side things were duplicated client-side
for no good reason, but the worst thing about it was the data format it used.
It was somewhat future-proof, but not human-friendly, because it was just a
tuple: it was possible to append things to it (as was done in e.g.
4d7cfa1867b5), but you'd then have to remember the indices and reading the
resulting JS code wasn't easy, because cur[8] is not descriptive at all.

So what would need to happen for graph to have more features, such as more
changeset information or a different vertex style (branch-closing, obsolete)?
First you'd need to take some property, process it (e.g. escape and pass
through templatefilters function, and mind the encoding too), append it to
jsdata and remember its index, then go add nearly identical JavaScript code to
4 different hgweb themes that use jsdata to render HTML, and finally try and
forget how brittle it all felt. Oh yeah, and the indices go to double digits if
we add 2 more items, say phase and obsolescence, and there are more to come.
Rendering vertex in a different style would need another property (say,
character "o", "_", or "x"), except if you want to be backwards-compatible, it
would need to go after tags and bookmarks, and that just doesn't feel right.

So here I'm trying to fix both the duplication of code and the data format:

- changesets will be rendered by hgweb templates the same way as changelog and
  other such pages, so jsdata won't need any information that's not needed for
  rendering the graph itself

- jsdata will be a dict, or an Object in JS, which is a lot nicer to humans and
  is a lot more future-proof in the long run, because it doesn't use numeric
  indices

What about hgweb themes? Obviously, this will break all hgweb themes that
render graph in JavaScript, including 3rd-party custom ones. But this will also
reduce the size of client-side code and make it more uniform, so that it can be
shared across hgweb themes, further reducing its size. The next few patches
demonstrate that it's not hard to adapt a theme to these changes. And in a
later series, I'm planning to move duplicate JS code from */graph.tmpl to
mercurial.js and leave only 4 lines of code embedded in those <script>
elements, and even that would be just to allow redefining graph.vertex
function. So adapting a custom 3rd-party theme to these changes would mean:

- creating or copying graphnode.tmpl and adding it to the map file (if a theme
  doesn't already use __base__)

- modifying one line in graph.tmpl and simply removing the bigger part of
  JavaScript code from there

Making these changes in this patch and not updating every hgweb theme that uses
jsdata at the same time is a bit of a cheat to make this series more
manageable: /graph pages that use jsdata are broken by this patch, but since
there are no tests that would detect this, bisect works fine; and themes are
updated separately, in the next 4 patches of this series to ease reviewing.
2017-12-01 16:00:40 +08:00
Anton Shestakov
43f716d8d5 hgweb: adopt child nodes in ajaxScrollInit on /graph pages too
ajaxScrollInit is a function that loads more elements (e.g. changelog entries)
when browser window is scrolled down to the bottom of the page. It basically
fetches the next page from the server as HTML, finds container element in that
document and "adopts" (essentially, moves) all its child nodes to the container
in the current document.

Currently, hgweb doesn't render any changesets on /graph page (everything is
done in JavaScript), so there are no children to adopt. But there will be soon,
so let's create a reusable function that does it.

Hardcoding #graphnodes selector is suboptimal, but graph code already does this
in two other places.
2017-12-01 14:17:20 +08:00
Matt Harbison
ed55294406 lfs: enable the extension locally after converting to an 'lfs' repo
This is consistent with clone and share in the previous commits.
2017-11-26 21:14:48 -05:00
Matt Harbison
fa06b74028 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
This is consistent with clone in the previous commit.
2017-11-16 21:01:21 -05:00
Matt Harbison
26786fa7df lfs: enable the extension locally after cloning a repo with 'lfs' requirement
We do the same thing on clone for the largefiles extension, as a convenience.
Similar to largefiles, it's probably safer to only enable this extension on a
per repo basis because it is trivial to add an lfs file.  And that gives the
repository some centralized VCS characteristics.
2017-11-16 20:23:20 -05:00
Yuya Nishihara
2c811cd701 log: translate column labels at once (issue5750)
This makes sure that all columns are aligned. getlogcolumns() is hosted by
templatekw so the namespaces module can see it.

i18n/de.po is updated so test-log.t passes with no error. "obsolete:" and
"instability:" are kept untranslated.
2017-12-02 16:29:49 +09:00
Yuya Nishihara
9d926f0131 log: remove temporary variable 'date' used only once 2017-12-02 16:08:24 +09:00
Augie Fackler
bfcc4b085d merge with stable 2017-12-04 11:28:29 -05:00
Boris Feld
6fefecff91 lock: allow to configure when the lock messages are displayed
We add a new 'ui.timeout.warn' config to set a grace period before we display
lock related warning:

    waiting for lock on PATH held by PROCESS

The config is based on 'ui.timeout' and expresses a number of seconds before
the warning is displayed. Negative values disable the warning altogether.

The messages go to the debug output to help people trouble-shooting deadlocks.
2017-11-29 20:39:59 -05:00
Boris Feld
87115045d0 lock: add a trylock method handling the timeout and messaging logic
We are about to make the messages around lock more flexible. We move all the
currently logic into a function in the lock module. We'll update the message
scheme in the next changeset.
2017-11-29 20:36:29 -05:00
Boris Feld
ce5945f52a lock: use configint for 'ui.timeout' config
The ui object can do the conversion itself.
2017-11-29 21:00:02 -05:00
Boris Feld
d4021aee4f scmutil: improve format pattern used in nodesummaries
As spotted by Yuya Nishihara, that value is an integer.
2017-12-04 09:39:37 +01:00
Matt Harbison
c0662d6461 tests: trivial fixes for Windows 2017-12-02 17:52:53 -05:00
Pulkit Goyal
174b204536 py3: use encoding.strtolocal() to convert string to bytes
Differential Revision: https://phab.mercurial-scm.org/D1557
2017-11-29 08:40:25 +05:30
Pulkit Goyal
4aa252d4b0 py3: use pycompat.bytestr() or '%d' in place of str()
Differential Revision: https://phab.mercurial-scm.org/D1556
2017-11-29 08:39:48 +05:30