Commit Graph

4401 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
3127f4abb3 largefiles: show also how many data entities are outgoing at "hg summary"
Before this patch, "hg summary --large" shows how many largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.

For example, according to the number of outgoing largefiles shown in
"hg summary" output, users should expect that the former below costs
much more to upload outgoing largefiles than the latter.

  - outgoing revisions add a hundred largefiles, but all of them refer
    the same data entity

    in this case, only one data entity is outgoing, even though "hg
    summary" says that a hundred largefiles are outgoing.

  - a hundred outgoing revisions change only one largefile with
    distinct data

    in this case, a hundred data entities are outgoing, even though
    "hg summary" says that only one largefile is outgoing.

But the latter costs much more than the former, in fact.

This patch shows also how many data entities are outgoing at "hg
summary" by counting number of unique hash values for outgoing
largefiles.

This patch introduces "_getoutgoings" to centralize the logic
(de-duplication, too) into it for convenience of subsequent patches,
even though it is not required in "hg summary" case.
2014-07-07 18:45:46 +09:00
Matt Mackall
5fc8526562 merge with stable 2014-07-14 18:53:03 -05:00
FUJIWARA Katsunori
8ae5e732ec convert: detect removal of ".gitmodules" at git source revisions correctly
Before this patch, all operations applied on ".gitmodules" at git
source revisions are treated as modification, even if they are
actually removal of it.

If removal of ".gitmodules" is treated as modification unexpectedly,
"hg convert" is aborted by the exception raised in
"retrievegitmodules()" for ".gitmodules" at the git source revision
removing it, because that revision doesn't have any information of
".gitmodules".

This patch detects removal of ".gitmodules" at git source revisions
correctly.

If ".gitmodules" is removed at the git source revision, this patch
records "hex(nullid)" as the contents hash value for ".hgsub" and
".hgsubstate" at the destination revision.

This patch makes "getfile()" raise IOError also for ".hgstatus" and
".hgsubstate" if the contents hash value is "hex(nullid)", and this
tells removal of ".hgstatus" and ".hgsubstate" at the destination
revision to "localrepository.commitctx()" correctly.

For files other than ".hgstatus" and ".hgsubstate", checking the
contents hash value in "getfile()" may be redundant, because
"catfile()" for them also does so.

But this patch chooses writing it only once at the beginning of
"getfile()", to avoid writing same code twice both for ".hgsub" and
".hgsubstate" separately.
2014-07-14 23:33:59 +09:00
FUJIWARA Katsunori
2038822d9f progress: use 'encoding.colwidth' to get column width of items correctly
Before this patch, 'progress' extension applies 'len' on byte sequence
to get column width of it, but it causes incorrect result, when length
of byte sequence and columns in display are different from each other
in multi-byte characters.

This patch uses 'encoding.colwidth' to get column width of items in
output line correctly, even if it contains multi-byte characters.
2014-07-06 02:56:41 +09:00
FUJIWARA Katsunori
d07c57ee16 progress: use 'encoding.trim' to trim items in output line correctly
Before this patch, 'progress' extension trims items in output line by
directly slicing byte sequence, but it may split at intermediate
multi-byte sequence.

This patch uses 'encoding.trim' to trim items in output line
correctly, even if it contains multi-byte characters.
2014-07-06 02:56:41 +09:00
FUJIWARA Katsunori
8469506e74 progress: use 'encoding.colwidth' to get column width of output line correctly
Before this patch, 'progress' extension applies 'len' on byte sequence
to get column width of it, but it causes incorrect result, when length
of byte sequence and columns in display are different from each other
in multi-byte characters.

This patch uses 'encoding.colwidth' to get column width of output line
correctly, even if it contains multi-byte characters.
2014-07-06 02:56:41 +09:00
FUJIWARA Katsunori
7cbb15561a progress: use 'encoding.trim' to trim output line correctly
Before this patch, 'progress' extension trims output line by directly
slicing byte sequence, but it may split at intermediate multi-byte
sequence.

This patch uses 'encoding.trim' to trim output line correctly, even if
it contains multi-byte characters.

"rm -f loop.pyc" before changing "loop.py" in "test-progress.t"
ensures that re-compilation of "loop.py", even if "loop.py" and
"loop.pyc" have same timestamp in seconds.
2014-07-06 02:56:41 +09:00
FUJIWARA Katsunori
9aa5fab4ec histedit: use 'util.ellipsis' to trim description of each changesets
Before this patch, trimming description of each changesets in histedit
may split at intermediate multi-byte sequence.

This patch uses 'util.ellipsis' to trim description of each changesets
instead of directly slicing byte sequence.

Even though 'util.ellipsis' adds '...' as ellipsis when specified
string is trimmed (= this changes result of trimming), this patch uses
it, because:

  - it can be used without any additional 'import', and
  - ellipsis seems to be better than just trimming, for usability
2014-07-06 02:56:41 +09:00
Matt Mackall
87914088c5 strip: drop -b/--backup option (BC)
This option had very limited utility and counterintuitive behavior and
collided unfortunately with the much later -B option.

Normally we would no-op such a feature so as to avoid annoying existing
scripts. However, we have to weigh that against the silent misbehavior
that results when users mistakenly intended to use -B: because -b
takes no arg, the bookmark gets interpreted as a normal revision, and
gets stripped without removing the associated bookmark, while also not
backing up the revision in question. A no-op behavior or warning would only
remove the latter half of the misadventure.

The only users I can find of this feature were using it in error and
have since stopped. The few (if any) remaining users of this feature
would be better served by --no-backup.
2014-07-11 18:04:51 -05:00
Jim Hague
15bbbb3991 bugzilla: stop trying to cache setup across hook invocation
In the context of standalone Hg receiving a set of incoming changes, it makes
sense for the Bugzilla module to cache basic setup to avoid reconnecting
to Bugzilla for each change. After processing the changes, Hg will exit
and so the connection is short-lived.

But this doesn't work too well when used from a long-lived environment
such as hgweb or Kallithea where, for example, the connection can time out.
So take the simple approach, abandon the cache and do the basic setup on
each call. This fixes current problems with Kallithea.
2014-07-03 10:48:37 +01:00
Jim Hague
a8d33ec9dd bugzilla: correct config documentation error
The config documentation specifies the wrong access method in the XMLRPC+email
configuration.
2014-07-03 10:56:03 +01:00
Augie Fackler
401a23725d rebase: fix bug that caused transitive copy records to disappear (issue4192)
The defect was that copies were always duplicated against the target
revision, rather than the first parent of the revision being
rebased. This produced nominally correct results if changes were
rebased one at a time (or with --collapse), but was wrong if we
rebased a sequence of changesets which contained a sequence of copies.
2014-06-07 15:23:12 -04:00
Matt Mackall
2ec4f75e9f p4: accept changesets with no description (issue4282) 2014-06-16 12:04:48 -05:00
FUJIWARA Katsunori
be42d4e90f keyword: suppress keyword expansion while 'hg fetch' for internal merge
Before this patch, 'hg fetch' may cause unexpected conflict, if 'hg
fetch'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg fetch' for internal
merge by adding 'fetch' to 'restricted' command list like 'merge'.

This patch uses 'hg import' to safely create the new head to be merged
at succeeding 'hg fetch', because:

  - branch of revision #10 is different from one of #11 in 'Test'
    repository, so just 'hg fetch -r 11' doesn't cause merging between
    them

    this means the new head should be created manually.

  - 'hg import' is easier and safer than 'cat <<EOF' and 'hg commit'
    to replay same changes including special characters like '$'

    safeness of 'hg import' with keyword extension is already examined
    in 'test-keyword.t'.
2014-06-05 16:47:14 +09:00
FUJIWARA Katsunori
72499b84e4 keyword: suppress keyword expansion while 'hg histedit' for internal merge
Before this patch, 'hg histedit' may cause unexpected conflict, if 'hg
histedit'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg histedit' for
internal merge by adding 'histedit' to 'restricted' command list like
'merge'.

Test in this patch just swaps order of revision #13 and #14: this is
enough to cause internal merge.
2014-06-05 16:47:14 +09:00
FUJIWARA Katsunori
28390e14b9 keyword: suppress keyword expansion while 'hg backout' for internal merge
Before this patch, 'hg backout' may cause unexpected conflict, if 'hg
backout'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg backout' for
internal merge by adding 'backout' to 'restricted' command list like
'merge'.
2014-06-05 16:47:14 +09:00
FUJIWARA Katsunori
7975a9241d keyword: suppress keyword expansion while 'hg graft' for internal merge
Before this patch, 'hg graft' may cause unexpected conflict, if 'hg
graft'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg graft' for internal
merge by adding 'graft' to 'restricted' command list like 'merge'.
2014-06-05 16:47:14 +09:00
FUJIWARA Katsunori
eba66d1a78 keyword: suppress keyword expansion while 'hg rebase' for internal merge
Before this patch, 'hg rebase' may cause unexpected conflict, if 'hg
rebase'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg rebase' for internal
merge by adding 'rebase' to 'restricted' command list like 'merge'.

This patch specifies '--keep' to 'hg rebase', because revision #10 is
useful also for tests in succeeding patches.
2014-06-05 16:47:13 +09:00
FUJIWARA Katsunori
571246a1be keyword: suppress keyword expansion while 'hg unshelve' for internal merge
Before this patch, 'hg unshelve' may cause unexpected conflict, if 'hg
unshelve'-ed changes are located near lines in which keywords are
embedded, because keywords are substituted with other strings in the
working directory.

This patch suppresses keyword expansion while 'hg unshelve' for
internal merge by adding 'unshelve' to 'restricted' command list like
'merge'.
2014-06-05 16:47:13 +09:00
Jim Hague
14c4476395 bugzilla: support Bugzilla 4.4.3+ API login token authentication (issue4257)
Bugzilla 4.4.3 and later remove the old cookie based session authentication
from the Web Services API and replace it with a login token. The session
can now also be restricted to the originating IP.

Add the necessary to the extension so it works with 4.4.3 and later.
2014-05-23 17:29:04 +01:00
Mads Kiilerich
99c7bacd5e color: don't fail on error messages when no curses (issue4237)
The error only occured when Python didn't have curses - such as on Windows and
when Python was built without curses support.

No curses can also be emulated by (re)moving .../lib/python2.7/curses/ from the
Python installation.

It is left as an exercise to figure out exactly what changed in Mercurial that
triggered this error.
2014-05-03 03:29:30 +02:00
Mads Kiilerich
34f9998bde rebase: empty revset should be a gentle no-op with exit code 1, not an error 2014-05-01 16:47:50 +02:00
Mads Kiilerich
9a144bfa2e largefiles: better handling of log from other working directory (issue4236)
When invoked from another directory, the matchers m._cwd will be the absolute
path. The code for calculating relative path to .hglf did not consider that and
log would fail with weird errors and paths.

For now, just don't do any largefile magic when invoked from other directories.
2014-05-01 15:12:49 +02:00
Julien Cristau
24f866301b rebase: don't abort if we're asked to rebase an empty revset
The documentation says we exit 1 if we have nothing to do, so avoid
breaking that contract when we're passed an empty revset.

This was changed in http://www.selenic.com/hg/rev/1d4f2abc281b to
improve the error message; keep the improved message, just not the
abort.
2014-04-23 13:51:35 +02:00
Matt Harbison
66d98ca80b largefiles: remove directories emptied after their files are moved (issue3515) 2014-04-25 22:34:09 -04:00
Yuya Nishihara
178ed58ae3 color: add missing handling of stderr capture introduced by 1428763bd397
It wouldn't raise exception without this change, but _bufferstates was wrong
because of missing _bufferstates.pop() in colorui.popbuffer().
2014-04-27 15:09:48 +09:00
Wagner Bruna
7f9ce654b1 histedit, i18n: replace '+' with concatenation to make hggettext happy 2014-04-22 10:14:16 -03:00
Isaac Jurado
3b2cb9598b churn: compute padding with unicode strings
Most UTF-8 aware terminals convert multibyte sequences into a single displayed
characters.  Because the first column is padded by counting bytes, the second
column is not perfectly aligned in the presence of non ASCII characters.
2014-04-19 15:11:25 +02:00
Ben Kehoe
3b4d556fee purge: add options for deleting only files or only directories 2013-11-07 17:24:14 -08:00
FUJIWARA Katsunori
dc3a08f408 shelve: accept '--edit' like other commands creating new changeset
After this patch, users can invoke editor for the commit message by
'--edit' option regardless of '--message'.
2014-06-20 16:15:38 +09:00
FUJIWARA Katsunori
5d92453e00 shelve: refactor option combination check to easily add new ones
Before this patch, the name of a newly added option had to be added
into each string that was passed to the "checkopt()" internal
function: these are white-space-separated list of un-acceptable option
names (= "black list" for the specified "opt").

This new option had to be added into multiple strings because each
option could belong to only one action of "create", "cleanup",
"delete" or "list".

In addition to this redundancy, each string passed to "checkopt()" was
already too long to include a new one.

This patch refactors option combination check to make it easier to add
a new option in a subsequent patch.

New "checkopt()" only takes one action ("cleanup", "delete" or
"list"), and checks whether all explicitly activated options are
allowed for it or not (if specified action is activated in "opts").

The "date" entry is listed in "allowables", but commented out,
because:

  - "date" shouldn't be checked for test

    checking "date" causes unexpected failure of "test-shelve.t",
    because "run-test.py" puts "[default] shelve = --date '0 0'" into
    hgrc.

  - explicitly listing it can advertise that ignoring it is intentional

This patch doesn't choose "white list" for the specified "opt", to
avoid treating global options.
2014-06-20 16:15:38 +09:00
Matt Mackall
a34a093097 merge with stable 2014-07-09 12:30:12 -05:00
David Soria Parra
2dc9732a35 strip: remove bookmarks after strip succeed (issue4295)
In case we have revs to strip, delete the bookmark after the strip succeeds, not
beforehand as we might still abort due to dirty working directory, etc.
2014-07-08 16:24:23 -07:00
Lucas Moscovicz
097fe28381 largefiles: changed overridelog to work with graphlog
Log for largefiles was failing for graph log since it was overriding match
instead of matchandpats.

[Mads Kiilerich modified this patch to address his review comments and ended up
rewriting/removing most of it.]
2014-03-05 15:55:09 -08:00
FUJIWARA Katsunori
c0e0086074 i18n: fix "% inside _()" problem 2014-04-16 03:05:00 +09:00
Mads Kiilerich
fafe3113c1 largefiles: revert override, install matchfn outside the try/except restoring it 2014-04-13 18:45:43 +02:00
Matt Mackall
3fd77ddc42 merge with stable 2014-07-02 00:01:13 -05:00
Jordi Gutiérrez Hermoso
a3f845b50e record: update comment to match code
Commit 9bcdffd81aaf changed how newfiles get passed to commitfunc, but
did not change the corresponding comment that explains this. This
commit also updates this comment.
2014-06-26 11:10:28 -04:00
Gregory Szorc
6000635fc2 record: define inferrepo in command decorator 2014-05-04 22:36:07 -07:00
Gregory Szorc
fb9bbaae28 mq: define inferrepo in command decorator 2014-05-04 22:30:47 -07:00
Gregory Szorc
7f17da465d largefiles: define inferrepo in command decorator 2014-05-04 22:23:45 -07:00
Gregory Szorc
ef5fffe0f4 keyword: define inferrepo in command decorator 2014-05-04 22:32:15 -07:00
Gregory Szorc
1c22a6414d hgk: define inferrepo in command decorator 2014-05-04 22:33:22 -07:00
Gregory Szorc
2492c3fec8 graphlog: define inferrepo in command decorator 2014-05-04 22:28:46 -07:00
Gregory Szorc
3086949df4 extdiff: define inferrepo in command decorator 2014-05-04 22:29:27 -07:00
Gregory Szorc
733a467d4e children: define inferrepo in command decorator 2014-05-04 22:25:28 -07:00
Gregory Szorc
63adcaf1da churn: define inferrepo in command decorator 2014-05-04 22:24:38 -07:00
Gregory Szorc
edfe6d451c keyword: define optionalrepo in command decorator 2014-05-04 22:16:56 -07:00
Gregory Szorc
564ed0a4b1 share: define norepo in command decorator 2014-05-04 22:03:11 -07:00
Gregory Szorc
bb3762da6d mq: define norepo in command decorator 2014-05-04 22:04:14 -07:00