Siddharth Agarwal <sid0@fb.com> [Fri, 21 Nov 2014 16:02:26 -0800] rev 23692
tests/autodiff.py: explicitly only honor feature diffopts
This test extension manages the opts it cares about on its own anyway.
Siddharth Agarwal <sid0@fb.com> [Fri, 21 Nov 2014 16:01:55 -0800] rev 23691
cmdutil.changeset_printer: explicitly honor all diffopts
This is used in hg log -p so the output is expected to be the same as that of
hg diff.
Siddharth Agarwal <sid0@fb.com> [Tue, 18 Nov 2014 22:21:03 -0800] rev 23690
export: explicitly honor all diffopts
This is slightly more controversial than diff, but we hope that HGPLAIN=1
covers all the format-breaking ones.
A possible alternative here that breaks BC is to honor all opts except the
whitespace ones.
Siddharth Agarwal <sid0@fb.com> [Fri, 21 Nov 2014 16:16:03 -0800] rev 23689
webcommands.annotate: explicitly only honor whitespace diffopts
The whitespace ones are the only ones the annotate logic cares about anyway, so
there's no visible impact.
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 23 Dec 2014 18:29:03 -0800] rev 23688
filectx.parents: filter nullrev parent sooner
We are going to introduce a linkrev-correction phases when computing parents.
It will be more convenient to have the nullid parent filtered out earlier. I
had to make a minimal adjustment to the rename handling logic to keep it
functional. That logic have been documented in the process since it took me
some time to check all the cases out.
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 23 Dec 2014 17:13:51 -0800] rev 23687
context: catch FilteredRepoLookupError instead of RepoLookupError
Now that we have a more specialised exception, lets use it when we meant to
catch the more specialised case.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 27 Nov 2014 10:16:56 -0500] rev 23686
narrowmatcher: propagate the rel() method
The full path is propagated to the original match object since this is often
used directly for printing a file name to the user. This is cleaner than
requiring each caller to join the prefix with the file name prior to calling it,
and will lead to not having to pass the prefix around separately. It is also
consistent with the bad() and abs() methods in terms of the required input. The
uipath() method now inherits this path building property.
There is no visible change in path style for rel() because it ultimately calls
util.pathto(), which returns an os.sep based path. (The previous os.path.join()
was violating the documented usage of util.pathto(), that its third parameter be
'/' separated.) The doctest needed to be normalized to '/' separators to avoid
test differences on Windows, now that a full path is returned for a short
filename.
The test changes are to drop globs that are no longer necessary when printing an
absolute file in a subrepo, as returned from match.uipath(). Previously when
os.path.join() was used to add the prefix, the absolute path to a file in a
subrepo was printed with a mix of '/' and '\'. The absolute path for a file not
in a subrepo, as returned from match.uipath(), is still purely '/' based.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Nov 2014 20:15:46 -0500] rev 23685
match: add the abs() method
This is a utility to make it easier for subrepos to convert a file name to the
full path rooted at the top repository. It can replace the various path joining
lambdas, and doesn't require the prefix to be passed into the method that wishes
to build such a path.
The name is derived from the following pattern in annotate() and other places:
name = ((pats and rel) or abs)
The pathname separator is not os.sep in part to avoid confusion with variables
named 'abs' or similar that _are_ '/' separated, and in part because some
methods like cmdutils.forget() and maybe cmdutils.add() need to build a '/'
separated path to the root repo. This can replace the manual path building
there.
Matt Mackall <mpm@selenic.com> [Mon, 29 Dec 2014 16:39:20 -0600] rev 23684
merge with stable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 25 Dec 2014 23:33:26 +0900] rev 23683
posix: quote the specified string only when it may have to be quoted
This patch makes "posix.shellquote" examine the specified string and
quote it only when it may have to be quoted for safety, like as the
previous patch for "windows.shellquote".
In fact, on POSIX environment, quoting itself doesn't cause issues
like
issue4463. But (almost) equivalent quoting policy can avoid
examining test result differently on POSIX and Windows (even though
showing command line with "%r" causes such examination in
"test-extdiff.t").
The last hunk for "test-extdiff.t" in this patch isn't needed for the
previous patch for "windows.shellquote", because the code path of it
is executed only "#if execbit" (= avoided on Windows).
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 25 Dec 2014 23:33:26 +0900] rev 23682
windows: quote the specified string only when it has to be quoted
Before this patch, "windows.shellquote" (as used as "util.shellquote")
always quotes specified strings with double quotation marks, for
external process invocation.
But some problematic applications can't work correctly, when command
line arguments are quoted: see
issue4463 for detail.
On the other hand, quoting itself is needed to specify arguments
containing whitespaces and/or some special characters exactly.
This patch makes "windows.shellquote" examine the specified string and
quote it only when it may have to be quoted for safety.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 25 Dec 2014 23:33:26 +0900] rev 23681
extdiff: rename the name of an argument for readability
To reduce amount of changes for review-ability, previous patch uses
"args" as argument name of "dodiff()", even though "args" includes
also the name of command to be executed (or full-path of it).
This patch replaces "args" by more appropriate name "cmdline".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 25 Dec 2014 23:33:26 +0900] rev 23680
extdiff: avoid unexpected quoting arguments for external tools (
issue4463)
Before this patch, all command line arguments for external tools are
quoted by the combination of "shlex.split" and "util.shellquote". But
this causes some problems.
- some problematic commands can't work correctly with quoted arguments
For example, 'WinMerge /r ....' is OK, but 'WinMerge "/r" ....' is
NG. See also below for detail about this problem.
https://bitbucket.org/tortoisehg/thg/issue/3978/
- quoting itself may change semantics of arguments
For example, when the environment variable CONCAT="foo bar baz':
- mydiff $CONCAT => mydiff foo bar baz (taking 3 arguments)
- mydiff "$CONCAT" => mydiff "foo bar baz" (taking only 1 argument)
For another example, single quoting (= "util.shellquote") on POSIX
environment prevents shells from expanding environment variables,
tilde, and so on:
- mydiff "$HOME" => mydiff /home/foobar
- mydiff '$HOME' => mydiff $HOME
- "shlex.split" can't handle some special characters correctly
It just splits specified command line by whitespaces.
For example, "echo foo;echo bar" is split into ["echo",
"foo;echo", "bar"].
On the other hand, if quoting itself is omitted, users can't specify
options including space characters with "--option" at runtime.
The root cause of this issue is that "shlex.split + util.shellquote"
combination loses whether users really want to quote each command line
elements or not, even though these can be quoted arbitrarily in
configurations.
To resolve this problem, this patch does:
- prevent configurations from being processed by "shlex.split" and
"util.shellquote"
only (possibly) "findexe"-ed or "findexternaltool"-ed command path
is "util.shellquote", because it may contain whitespaces.
- quote options specified by "--option" via command line at runtime
This patch also makes "dodiff()" take only one "args" argument instead
of "diffcmd" and "diffopts. It also omits applying "util.shellquote"
on "args", because "args" should be already stringified in "extdiff()"
and "mydiff()".
The last hunk for "test-extdiff.t" replaces two whitespaces by single
whitespace, because change of "' '.join()" logic causes omitting
redundant whitespaces.
Mathias De Maré <mathias.demare@gmail.com> [Sun, 28 Dec 2014 23:59:57 +0100] rev 23679
subrepo: add forgotten annotation for reverting git subrepos
Support for reverting git subrepos was added earlier,
but the annotation to handle any subrepo errors was forgotten.
Mathias De Maré <mathias.demare@gmail.com> [Sun, 28 Dec 2014 10:42:25 +0100] rev 23678
subrepo: add full revert support for git subrepos
Previously, revert was only possible if the '--no-backup'
switch was specified.
Now, to support backups, we explicitly go over all modified
files in the subrepo.
Ludovic Chabant <ludovic@chabant.com> [Tue, 23 Dec 2014 19:54:48 -0800] rev 23677
setup: don't fail when Python doesn't have the cygwinccompiler package
Some Python installations like the ones available from the optware
project
for the Synology DiskStation NASes don't have that package, which means
running the setup script will crash and exit right away. Instead, we now
just use an empty/fake class for the HackedMingw32CCompiler, which we
likely won't use anyway.
Thomas Klausner <tk@giga.or.at> [Sun, 28 Dec 2014 23:50:08 +0100] rev 23676
tests: adapt glob pattern to fix test with NetBSD's sh(1) (
issue4484)
Thomas Klausner <tk@giga.or.at> [Sun, 28 Dec 2014 21:30:52 +0100] rev 23675
tests: run 'cvs init' only on non-existent directories (
issue4482)
Do not create cvsroot directory since cvs-1.12 errors out
if CVSROOT exists before 'cvs init'.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Dec 2014 21:50:35 -0500] rev 23674
remove: use vfs instead of os.path + match.rel() for filesystem checks
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Dec 2014 21:43:45 -0500] rev 23673
forget: use vfs instead of os.path + match.rel() for filesystem checks
Matt Harbison <matt_harbison@yahoo.com> [Wed, 24 Dec 2014 12:07:59 -0500] rev 23672
tests: make a multi-statement hook in bundle2-exchange Windows compatible
This is similar to the fix in
7dd1870120b2.
Matt Mackall <mpm@selenic.com> [Mon, 29 Dec 2014 14:27:02 -0600] rev 23671
sshpeer: more thorough shell quoting
This fixes an issue spotted by Jesse Hertz.
Matt Mackall <mpm@selenic.com> [Mon, 29 Dec 2014 13:10:47 -0600] rev 23670
merge with stable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 29 Dec 2014 15:59:56 +0900] rev 23669
i18n-ja: synchronized with
3b84bde06d17
Wagner Bruna <wbruna@softwareexpress.com.br> [Fri, 26 Dec 2014 17:21:08 -0200] rev 23668
i18n-pt_BR: synchronized with
53a65929ef1f
Angel Ezquerra <angel.ezquerra@gmail.com> [Tue, 23 Dec 2014 19:48:38 +0100] rev 23667
localrepo: use the vfs join method to implement the localrepo join method
This will make it possible to customize the behavior of the join method by
changing the vfs class (e.g. by using the altvfs" class introduced recently).
Note that we could have modified the VFS join methods to acept a set of optional
paths in the same way thta the localrepo join method does. However it seemed
simpler to simply call os.path.join before calling self.vfs.join.
Angel Ezquerra <angel.ezquerra@gmail.com> [Sun, 21 Dec 2014 00:19:10 +0100] rev 23666
localrepo: introduce shared method to check if a repository is shared
Up until now we compared the "path" and "sharedpath" repository properties to
check if a repository is shared. This was relying an implementation detail of
shared repositories. In order to make it possible to change the way shared
repositories are implemented, we encapsulate this check into its own localrepo
method, called shared.
This new method returns None if the repository is shared, and something else
(for now a string describing the short of share) otherwise.
The reason why I did not call this method "isshared" and made it return a
boolean is that I plan to introduce a new type of shared repository soon.
# NOTES:
This is the first patch in a series whose purpose is to add support for
creating "full repository shares", which are repositories that share everything
with the repository source except their current revision, branch and bookmark.
This series is RFC because I am not very sure of some of the solutions I took.
Comments are welcome!
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Dec 2014 16:16:26 -0800] rev 23665
trydiff: use 'ctx1.flags()' for symmetry with 'ctx2.flags()'
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Dec 2014 16:25:00 -0800] rev 23664
trydiff: use 'not in addedset' for symmetry with 'not in removedset'
With the previous change in place, we can safely use 'addedset'.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Dec 2014 16:12:54 -0800] rev 23663
trydiff: simplify checking for additions
In the body of the loop in trydiff(), there are conditions like:
addedset or (f in modifiedset and to is None)
The second half of that expression is to account for the fact that
merge-in additions appear as additions. By instead fixing up the sets
of modified and added files to compensate for this fact, we can
simplify the body of the loop. It also fixes one case where the
addedset was checked without the additional check (the "have we
already reported a copy above?" case in the code, also see fixed test
case).
The similar condition with 'removedset' in it seems to have served no
purpose even before this change, so it could have been simplified even
before.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Dec 2014 14:56:30 -0800] rev 23662
trydiff: extract 'date2' variable like existing 'date1'
Note that there is a comment saying "ctx2 date may be dynamic". The
comment was introduced in
dccb83241dd0 (patch: use contexts for diff,
2006-12-25), but it seems like it stopped being dynamic in that very
changeset -- before that changeset, the date seems to have been the
file's mtime, but after the changeset, it seems to be the changeset's
timestamp (current time for workingctx). Since no one seems to have
missed the "dynamicness", let's simplify and extract a date2 for
symmetry with date1.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Dec 2014 10:41:45 -0800] rev 23661
trydiff: use sets, not lists, for containment checks
This only has a noticeable effect on diffs touching A LOT of
files. For example, it takes
hg diff -r FIREFOX_AURORA_30_BASE -r FIREFOX_AURORA_35_BASE
from 1m55.465s to 1m32.354s. That diff has over 50k files.