Commit Graph

20896 Commits

Author SHA1 Message Date
Aaron Jensen
9aca899376 hgweb: adding branch, tags, bookmarks, user, and file list to rss feed entries 2014-04-16 09:32:04 -07:00
Aaron Jensen
294492a1d9 hgweb: adding branch, tags, bookmarks, user, and file list to atom feed entries 2014-04-16 09:31:37 -07:00
Mads Kiilerich
6c7f6f30ff patchbomb: warn when emailing a dirty working directory parent 2014-04-07 23:10:20 +02:00
Mads Kiilerich
10afc6afa5 tests: coverage of convert and filemap include and the default of include all 2014-03-19 00:19:54 +01:00
FUJIWARA Katsunori
039223a68b largefiles: remove no more referred "getoutgoinglfiles()" 2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
0c85153450 largefiles: use "outgoinghooks" to avoid redundant outgoing check
Before this patch, "hg outgoing" invokes "findcommonoutgoing()" not
only in "commands.outgoing()" but also in
"overrides.overrideoutgoing()" (via "getoutgoinglfiles()"), when
largefiles is enabled. The latter is redundant.

This patch uses "outgoinghooks" to avoid redundant outgoing check.

Newly introduced function "overrides.outgoinghook()" is registered
into "outgoinghooks" to get the result of outgoing check in
"commands.outgoing()".

It invokes "lfutil.getlfilestoupload()" directly with the result of
outgoing check to avoid redundant outgoing check in
"getoutgoinglfiles()": "sort()" is needed, because
"lfutil.getlfilestoupload()" doesn't sort the result of it.

This patch also omits "if toupload is None" ("No remote repo") case,
because failure of looking remote repository up should raise exception
in "commands.outgoing()" before invocation of "outgoinghooks".

Newly added "hg outgoing --large --graph" tests examine
"outgoinghooks" invocations in "hg outgoing --graph" code path.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
63865524f1 outgoing: introduce "outgoinghooks" to avoid redundant outgoing check
This patch introduces "outgoinghooks" to avoid redundant outgoing
check for "hg outgoing" in other than "commands.outgoing" (or utility
functions used by it).
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
f962e484fd hg: make "_outgoing()" return peer object for remote repository
This patch makes "_outgoing()" return peer object for remote
repository, to avoid re-execution "expandpath()", "parseurl()", and
"peer()" on caller side for specified URL.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
7c3a219e15 hg: make "_outgoing()" return empty list instead of "None"
This patch makes "_outgoing()" return empty list instead of "None", if
there are no outgoing changesets, because:

  - returning "None" requires callers to examine whether returned
    value is "None" or not explicitly, if callers want to execute loop
    on returned value, but

  - there are no explicit needs to return "None"
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
22be41c2e5 largefiles: use "summaryremotehooks" to avoid redundant outgoing check
Before this patch, "hg summary --remote --large" invokes
"findcommonoutgoing()" not only in "commands.summary()" but also in
"overrides.overridesummary()" (via "getoutgoinglfiles()"). The latter
is redundant.

This patch uses "summaryremotehooks" to avoid redundant outgoing check.

Newly introduced function "overrides.summaryremotehook()" is
registered into "summaryremotehooks" to get the result of outgoing
check in "commands.summary()".

It invokes "lfutil.getlfilestoupload()" directly with the result of
outgoing check to avoid redundant outgoing check in
"getoutgoinglfiles()".
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
090a597dc7 summary: introduce "summaryremotehooks" to avoid redundant incoming/outgoing check
This patch introduces "summaryremotehooks" to avoid redundant
incoming/outgoing check for "hg summary" in other than
"commands.summary".

Only if "--remote" is not specified for "hg summary", hooks registered
in "summaryremotehooks" are invoked with "None" as "changes" argument
at first, and they should return tuple of two booleans meaning
"whether incomings are needed" and "whether outgoings are needed".

If no hooks return tuple containing "True", "hg summary" does nothing
any more, because incoming/outgoing check is not needed.

Otherwise, hooks are invoked again: at this time, "changes" argument
refers the result of incoming/outgoing check.

This patch also prevents RepoError from being raised if "--remote" is
not specified for "hg summary", because of backward compatibility for
"hg summary --large" without "--remote".
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
18631f0006 util: enable "hooks" to return list of the values returned from each hooks 2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
16b89197f7 summary: separate checking incoming/outgoing and showing remote summary
This patch separates checking incoming/outgoing and showing remote
summary, as a preparation for refactoring in succeeding patches,
because:

  - checking incoming/outgoing may be needed, even if "--remote" is
    not specified for "hg summary"

  - checking incoming/outgoing may not be needed simultaneously

"hg summary --large" without "--remote" is typical case for these.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
3da856bfcc largefiles: reuse "findcommonoutgoing()" result at "hg push"
Before this patch, "hg push" invokes "findcommonoutgoing()" not only
in "exchange.push()" but also in "lfilesrepo.push()", when largefiles
is enabled. The latter is redundant.

This patch registers own "prepushoutgoinghook" function into
"prepushoutgoinghooks" of "localrepository" to reuse
"findcommonoutgoing()" result.

"prepushoutgoinghook" omits "changelog.nodesbetween()" invocation,
because "findcommonoutgoing()" invocation in "exchange.push()" takes
"onlyheads" argument and it considers "nodesbetween()".
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
7b1e8194b5 localrepo: introduce "prepushoutgoinghooks" to extend outgoing check easily
This patch introduces "prepushoutgoinghooks" to extend outgoing check
before pushing changesets to remote easily.

This chooses the function returning "util.hooks" instead of the one to
be overridden.

The latter may cause problems silently, if one of overriders forgets
(or fails) to execute a kind of "super(xxx, self).overridden(...)". In
the other hand, the former can ensure that all registered functions
are invoked, unless one of them raises an exception.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
a3f2ae29d0 largefiles: centralize the logic to get outgoing largefiles
Before this patch, "overrides.getoutgoinglfiles()" (called by
"overrideoutgoing()" and "overridesummary()") and "lfilesrepo.push()"
implement similar logic to get outgoing largefiles separately.

This patch centralizes the logic to get outgoing largefiles in
"lfutil.getlfilestoupload()".

"lfutil.getlfilestoupload()" takes "addfunc" argument, because each
callers need different information (and it is useful for enhancement
in the future).

  - "overrides.getoutgoinglfiles()" needs only filenames
  - "lfilesrepo.push()" needs only hashes of largefiles
2014-04-16 00:37:24 +09:00
Matt Harbison
615b124547 cat: support cat with explicit paths in subrepos
The cat command with an explicit path into a subrepo is now handled by invoking
cat on the file, from that subrepo.  The previous behavior was to complain that
the file didn't exist in the revision (of the top most repo).  Now when the file
is actually missing, the revision of the subrepo is named instead (though it is
probably desirable to continue naming the top level repo).

The documented output formatters %d and %p reflect the path from the top level
repo, since the purpose of this is to give the illusion of a unified repository.
Support for the undocumented (for cat) formatters %H, %R, %h, %m and %r was
added long ago (I tested back as far as 0.5), but unfortunately these will
reflect the subrepo node instead of the parent context.

The previous implementation was a bit loose with the return value, i.e. it would
return 0 if _any_ file requested was cat'd successfully.  This maintains that
behavior.
2014-03-14 21:32:05 -04:00
Matt Harbison
cb793b21fa cat: move most of the implementation into cmdutils.cat()
This will allow access to the reusable parts from subrepos, similar to add(),
forget(), etc.
2014-03-13 23:45:18 -04:00
Kent Frazier
3a04d9dac2 tests: mark test in tests/test-help.t as contingent on gettext being available 2014-04-15 17:51:27 -04:00
Kent Frazier
ddcb0f363a setup.py: fix C extension compilation issue with OS X 10.9 and Xcode 5.1 2014-04-15 16:27:12 -04:00
Sean Farley
52b090aab5 color: add effect to the template symbol table
Previously, words like 'red' had to be protected by quotes before passing to
the label template function. Now, we add color effects to the symbol table so
that commands like,

$ hg log -r . -T "{label(red, node|short)}\n"

can work without the need for quoting.
2014-04-14 18:21:26 -05:00
FUJIWARA Katsunori
6737a23301 amend: invoke editor forcibly when "--edit" option is specified
1fc59036a99b introduces "--edit" option into "hg commit", but it
doesn't work for "hg commit --amend", because 1fc59036a99b prepares
for editor invocation only around "commitfunc()" internal function,
which is used only for temporary amend commit by "cmdutil.amend()".

Actual commit message editing is executed in "cmdutil.amend()".

This patch invokes editor forcibly when "--edit" option is specified
for "hg commit --amend", even if commit message is specified
explicitly by "--message" or "--logfile".

This patch also removes useless handling for commit message and editor
invocation around "commitfunc()" internal function.
2014-04-16 02:38:11 +09:00
FUJIWARA Katsunori
c448280b69 commit: abolish useless "--force-editor" internal option for "hg commit"
"--force-editor" option for "hg commit" has been useless since
074e6345f65e, which makes "commands.tag()" invoke "cmdutil.commit()"
directly instead of "commands.commit()" with "--force-editor" internal
option.

This patch abolishes useless "--force-editor" internal option for "hg
commit".
2014-04-16 02:04:41 +09:00
Matt Mackall
404e995f87 subrepo: return non-zero exit code when a subrepo push doesn't succeed 2014-04-15 14:15:35 -04:00
Matt Mackall
ca3a6376d7 debugrevlog: use unfiltered view for changelog 2014-04-14 23:27:31 -04:00
Mads Kiilerich
dde33b4102 debugrevlog: format columns (more) nicely when dumping index data 2014-03-19 00:13:38 +01:00
Gregory Szorc
d620dd5f0f branchmap: log events related to branch cache
The blackblox log will now contain log events when the branch caches are
updated and written.
2014-03-22 17:14:37 -07:00
Gregory Szorc
0a33c75296 tags: log events related to tags cache
We now log when .hg/cache/tags data is built from scratch by reading
manifests and when the file is written.
2014-04-14 11:50:05 -07:00
Matt Mackall
6f3036019b merge with stable 2014-04-14 15:14:02 -04:00
FUJIWARA Katsunori
89625609bb histedit: save manually edited commit message into ".hg/last-message.txt"
Before this patch, manually edited commit message for "message"
command in histedit-ing is not saved into ".hg/last-message.txt" until
it is saved by "localrepository.savecommitmessage()" in
"localrepository.commit()".

This may lose such commit message, if unexpected exception is raised.

This patch saves manually edited commit message for "message" comand
in histedit-ing into ".hg/last-message.txt" just after user editing.

This is the simplest implementation to fix on stable. Editing and
saving commit message should be centralized into the framework of
"localrepository.commit()" with "editor" argument in the future.

This patch uses repository wrapping class for exception raising before
saving commit message in "localrepository.commit()" easily and
certainly, because such exception requires corner case condition.
2014-04-15 03:21:59 +09:00
Matt Mackall
b154d8d029 revlog: deal with chunk ranges over 2G on Windows (issue4215)
Python uses a C long (32 bits on Windows 64) rather than an ssize_t in
read(), and thus has a 2G size limit. Work around this by falling back
to reading one chunk at a time on overflow. This approximately doubles
our headroom until we run back into the size limit on single reads.
2014-04-07 14:18:10 -05:00
Sean Farley
750f67f948 tests: remove unused variables from test-pathencode.py caught by pyflakes 2014-04-03 20:35:56 -05:00
Sean Farley
3c09c4d895 shelve: remove unused variable caught by pyflakes 2014-04-03 20:32:56 -05:00
Sean Farley
90ccd3ca5f changegroup: remove unused variable caught by pyflakes 2014-04-03 20:29:03 -05:00
Matt Mackall
71fa6b44a6 Added signature for changeset bced32a3fd6c 2014-04-01 17:57:04 -05:00
Yuya Nishihara
370defd044 backout: correct commit status of no changes made (BC) (issue4190)
If backout generated no changes to commit, it showed wrong status, "changeset
<target> backs out changeset <target>", and raised TypeError with -v option.

This changes the return code to 1, which is the same as "hg commit" and
"hg rebase".
2014-03-08 18:52:16 +09:00
Yuya Nishihara
d616c909d1 backout: document return code of merge conflict 2014-03-08 18:41:56 +09:00
FUJIWARA Katsunori
0eed53de6c i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that format string consists of multiple string
components concatenated implicitly or explicitly,

This patch does below for that regexp pattern to detect "% inside _()"
problems in such case.

  - put "+" into separator part ("[ \t\n]") for explicit concatenation
    ("...." + "...." style)

  - enclose "component and separator" part by "(?:....)+" for
    concatenation itself ("...." "...." or "...." + "....")
2014-04-01 02:46:03 +09:00
FUJIWARA Katsunori
01d8b27701 i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that the format string and "%" aren't placed in the
same line.

This patch replaces "\s" in that regexp pattern with "[ \t\n]" to
detect "% inside _()" problems in such case.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-01 02:46:03 +09:00
FUJIWARA Katsunori
e0d81db88f merge: fix lack of "%s" in format string causing TypeError at runtime 2014-04-01 02:46:03 +09:00
Wagner Bruna
a79773afe1 i18n-pt_BR: synchronized with a61616787725 2014-04-01 13:27:12 -03:00
FUJIWARA Katsunori
c4397fd764 i18n-ja: synchronized with 53c6e4195bb0 2014-03-31 21:03:39 +09:00
Sean Farley
04ea4eb32d tests: use TESTTMP instead of TESTDIR
In d87f1c1d18fa, be4d37a43992, 394118f2cf71, and 7594c2ea371e, new tests were
added that used TESTDIR instead of TESTTMP thereby leading to polluting the
working directory with these temporary files. Now, we use TESTTMP so that they
will be cleaned up properly.
2014-03-28 14:33:27 -05:00
FUJIWARA Katsunori
920a8f861c hg: introduce "wirepeersetupfuncs" to setup wire peer by extensions (issue4109)
Since changeset a8955c4d9ef5, "reposetup()" of each extensions is
invoked only on repositories enabling corresponded extensions.

This causes that largefiles specific interactions between the
repository enabling largefiles locally and remote (wire) peer fail,
because there is no way to know whether largefiles is enabled on the
remote repository behind the wire peer, and largefiles specific
"wireproto functions" are not given to any wire peers.

To avoid this problem, largefiles should be enabled in wider scope
than each repositories (e.g. user-wide "${HOME}/.hgrc").

This patch introduces "wirepeersetupfuncs" to setup wire peer by
extensions already enabled. Functions registered into
"wirepeersetupfuncs" are invoked for all wire peers.

This patch uses plain list instead of "util.hooks" for
"wirepeersetupfuncs", because the former allows to control order of
function invocation by order of extension enabling: it may be useful
for workaround of problems with combination of enabled extensions
2014-03-29 01:20:07 +09:00
Sean Farley
029b060498 templater: raise error for unknown func
Previously, if a template '{foo()}' was given, the buildfunc would not be able
to match it and hit a code path that would not return so it would error out
later in the templater stating that NoneType was not iterable. This patch makes
sure that a proper error is raised so that the user can be informed.

Tests have been updated.
2014-03-27 17:21:27 -05:00
Jordi Gutiérrez Hermoso
4d640be53b dispatch: only do __import__(debugger) when a debugger is requested
When having ui.debugger=somedebugger in one's ~/.hgrc, this then
somedebugger would be imported for every hg command. With this patch,
this import only happens if the --debugger parameter is passed.
2014-03-07 14:06:52 -05:00
FUJIWARA Katsunori
c52b73121a hg: use "os.path.join()" to join path components which may be empty (issue4203)
Changset 39a4d61c40d6 rewriting "hg.copystore()" with vfs uses
'dstbase + "/lock"' instead of "os.path.join()", because target files
given from "store.copyfiles()" already uses "/" as path separator

But in the repository using revlog format 0, "dstbase" becomes empty
("data" directory is located under ".hg" directly), and 'dstbase +
"/lock"' is treated as "/lock": in almost all cases, write access to
"/lock" causes "permission denied".

This patch uses "os.path.join()" to join path components which may be
empty in "hg.copystore()".
2014-03-25 19:34:17 +09:00
Matt Harbison
60d20455df revset: document the regular expression support for tag(name)
This has been supported since 0041ea008c64, in 2.3.
2014-03-24 21:27:40 -04:00
Siddharth Agarwal
2fd618b0ed subrepo: add trailing newlines to warnings 2014-03-20 19:39:05 -07:00
Siddharth Agarwal
ab73247b7b subrepo: convert matched string to integer before comparing Git version
(1, '4') is greater than (1, 5) so the version check never actually worked.
2014-03-20 19:38:17 -07:00