"accurev diff" returns 0 for no diff, 1 for differences, and 2 for error
(like not being run from a workspace). Use 2 to indicate the file isn't
being versioned by AccuRev so Sy properly sets the vcs type to AccuRev
for unmodified files.
Previously, when using *nix csh-like (or probably ksh-like) shells, perforce
detection would fail with E484. This was due to hard-coded bash-like
redirection.
This change obeys the vim `shellredir` option when detecting perforce.
Use split() instead of substitute(), since the latter simply parses strings
and doesn't understand the notion of path separators. Backslashes would be
interpreted as beginning escape sequences.
Using split() works around this problem.
Closes#163.
This merge removes g:signify_diffoptions and replaces it by the much more
general g:signify_vcs_commands. Users can customize the entire command to be
run now.
This reverts commit 5cdf72acd1.
`shellescape()`, which is what `sy#util#escape()` is a front-end to, is
only supposed to escape a single element of an argv list. In this case,
it's being used to escape multiple -- `p4 info 2>&1 >`. None of that
should be escaped anyway, because they need to be interpreted by the
shell.
“p4 monitor info” isn't always available and can impose a heavy runtime
cost when it is if the server isn't responsive.
Closesmhinz/vim-signify#153
Signed-off-by: James McCoy <vega.james@gmail.com>
This handles the case where a user forces colors from the color extension via
hgrc:
[extensions]
color =
[defaults]
diff = --colors=always
Sy disables these for its 'hg diff' call, otherwise the output would be
riddled with color escape sequences and couldn't be parsed properly which
would result in no signs shown.
References #146.
Mercurial's detection for where a file's containing repo is doesn't work
well when the working directory is a different Mercurial repo (c.f.,
mhinz/vim-signify#146). Run "hg diff" from the target file's parent
directory to work around this.
Signed-off-by: James McCoy <vega.james@gmail.com>
If there are more than 99 deleted lines, the actual count isn't being
important anymore. Thus we just let it overflow and save another
conditional.
100 deleted lines -> "00"
Closes#109.
Defining the SignifyDelete set of signs on the fly provides the ability
to specify the exact line deletion count for up to 99 lines, rather than
the current limit of 9 lines.
This also has the benefit of reducing the number of signs defined when
there aren't many hunks of deleted lines. On the flip side, if there
are other sign-placing plugins in use, then it also increases the chance
of nearing the ~120 sign definition limit if there are many hunks of
varying line deletions.
Prior to this patch, it was not possible to dynamically apply arguments
to diff commands. The g:signify_diffoptions variable was only read when
the plugin was loaded.
This patch changes the behavior so that before each diff it checks
g:signify_diffoptions to see what arguments should be passed to the diff
tool.
The motivating use case behind this change is to be able to diff against
a different branch in Git via a key mapping. However, This change will
also allow any other arbitrary diff options to be dynamically updated,
such as whitespace, etc.
Example: Show diff against master instead of against HEAD in Git
nnoremap \u :let g:signify_diffoptions = { 'git': 'master'}<CR>:SignifyToggle<CR>