contrib/vim/patchreview.txt
author Manuel Jacob <me@manueljacob.de>
Wed, 24 Jun 2020 14:44:21 +0200
changeset 44998 f2de8f31cb59
parent 26098 ce26928cbe41
permissions -rw-r--r--
pycompat: use os.fsencode() to re-encode sys.argv Historically, the previous code made sense, as Py_EncodeLocale() and fs.fsencode() could possibly use different encodings. However, this is not the case anymore for Python 3.2, which uses the locale encoding as the filesystem encoding (this is not true for later Python versions, but see below). See https://vstinner.github.io/painful-history-python-filesystem-encoding.html for a source and more background information. Using os.fsencode() is safer, as the documentation for sys.argv says that it can be used to get the original bytes. When doing further changes, the Python developers will take care that this continues to work. One concrete case where os.fsencode() is more correct is when enabling Python's UTF-8 mode. Py_DecodeLocale() will use UTF-8 in this case. Our previous code would have encoded it using the locale encoding (which might be different), whereas os.fsencode() will encode it with UTF-8. Since we don’t claim to support the UTF-8 mode, this is not really a bug and the patch can go to the default branch. It might be a good idea to not commit this to the stable branch, as it could in theory introduce regressions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
     1
*patchreview.txt* Vim global plugin for doing single, multi-patch or diff code reviews
10550
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
     2
                  Version  v0.2.2 (for Vim version 7.0 or higher)
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
     3
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
     4
            Author: Manpreet Singh < junkblocker@yahoo.com >
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
     5
            Copyright (C) 2006-2010 by Manpreet Singh
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
     6
            License : This file is placed in the public domain.
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
     7
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
     8
=============================================================================
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
     9
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    10
CONTENTS	                 *patchreview* *diffreview* *patchreview-contents*
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    11
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    12
  1. Contents.........................................: |patchreview-contents|
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    13
  2. Introduction.....................................: |patchreview-intro|
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    14
  3. PatchReview options..............................: |patchreview-options|
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    15
  4. PatchReview Usage................................: |patchreview-usage|
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    16
     4.1 DiffReview Usage.............................: |:DiffReview|
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    17
     4.2 PatchReview Usage............................: |:PatchReview|
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    18
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    19
=============================================================================
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    20
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    21
PatchReview Introduction                                  *patchreview-intro*
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    22
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    23
The Patch Review plugin allows easy single or multipatch code or diff reviews.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    24
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    25
It opens each affected file in the patch or in a workspace diff in a diff view
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    26
in a separate tab.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    27
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    28
VIM provides the |:diffpatch| and related commands to do single file reviews
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    29
but can not handle patch files containing multiple patches as is common with
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    30
software development projects. This plugin provides that missing
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    31
functionality.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    32
26098
ce26928cbe41 spelling: behaviour -> behavior
timeless@mozdev.org
parents: 10550
diff changeset
    33
It also improves on |:diffpatch|'s behavior of creating the patched files in
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    34
the same directory as original file which can lead to project workspace
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    35
pollution.
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    36
10550
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    37
It does automatic diff generation for various version control systems by
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    38
running their diff command.
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    39
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    40
=============================================================================
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    41
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    42
PatchReview Options                                     *patchreview-options*
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    43
10550
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    44
  g:patchreview_patch = {string}
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    45
      Optional path to patch binary. PatchReview tries to locate patch on
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    46
      system path automatically. If the binary is not on system path, this
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    47
      option tell PatchReview the full path to the binary.  This option, if
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    48
      specified, overrides the default patch binary on the path.
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    49
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    50
    examples:
10550
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    51
        (On Windows with Cygwin) >
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    52
           let g:patchreview_patch = 'c:\\cygwin\\bin\\patch.exe'
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    53
<
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    54
        (On *nix systems) >
10550
8036bc1871c2 Updated contrib/vim/patchreview.* to version 0.2.2
Manpreet Singh <junkblocker@yahoo.com>
parents: 10545
diff changeset
    55
           let g:patchreview_patch = '/usr/bin/gpatch'
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    56
<
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    57
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    58
  g:patchreview_filterdiff = {string}
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    59
      Optional path to filterdiff binary. PatchReview tries to locate
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    60
      filterdiff on system path automatically. If the binary is not on system
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    61
      path, this option tell PatchReview the full path to the binary.  This
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    62
      option, if specified, overrides the default filterdiff binary on the
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    63
      path.
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    64
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    65
     examples:
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    66
        (On Windows with Cygwin)
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    67
>
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    68
           let g:patchreview_filterdiff = 'c:\\cygwin\\bin\\filterdiff.exe'
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    69
<
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    70
        (On *nix systems)
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    71
>
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    72
           let g:patchreview_filterdiff = '/usr/bin/filterdiff'
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    73
<
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    74
=============================================================================
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    75
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    76
PatchReview Usage                                          *patchreview-usage*
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    77
                                                                *:DiffReview*
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    78
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    79
  :DiffReview
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    80
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    81
    Perform a diff review in the current directory under version control.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    82
    Currently supports Mercurial (hg), Subversion (svn), CVS, Bazaar (bzr) and
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    83
    Monotone.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    84
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    85
                                                                *:PatchReview*
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    86
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    87
  :PatchReview patchfile_path [optional_source_directory]
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    88
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    89
    Perform a patch review in the current directory based on the supplied
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    90
    patchfile_path. If optional_source_directory is specified, patchreview is
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    91
    done on that directory. Otherwise, the current directory is assumed to be
2350
091d555653a4 contrib: patch review plugin for vim 7.0
Manpreet Singh <junkblocker@yahoo.com>
parents:
diff changeset
    92
    the source directory.
10545
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    93
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    94
    Only supports context or unified format patches.
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    95
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    96
------------------------------------------------------------------------------
b9e4a67329cd Updated contrib/vim/patchreview.* to version 0.2.1
Manpreet Singh <junkblocker@yahoo.com>
parents: 2350
diff changeset
    97
 vim: ft=help:ts=2:sts=2:sw=2:tw=78:norl: