contrib/vim/patchreview.txt
author Paul Morelle <paul.morelle@octobus.net>
Tue, 05 Jun 2018 08:19:35 +0200
changeset 38718 f8762ea73e0d
parent 26098 ce26928cbe41
permissions -rw-r--r--
sparse-revlog: implement algorithm to write sparse delta chains (issue5480) The classic behavior of revlog._isgooddeltainfo is to consider the span size of the whole delta chain, and limit it to 4 * textlen. Once sparse-revlog writing is allowed (and enforced with a requirement), revlog._isgooddeltainfo considers the span of the largest chunk as the distance used in the verification, instead of using the span of the whole delta chain. In order to compute the span of the largest chunk, we need to slice into chunks a chain with the new revision at the top of the revlog, and take the maximal span of these chunks. The sparse read density is a parameter to the slicing, as it will stop when the global read density reaches this threshold. For instance, a density of 50% means that 2 of 4 read bytes are actually used for the reconstruction of the revision (the others are part of other chains). This allows a new revision to be potentially stored with a diff against another revision anywhere in the history, instead of forcing it in the last 4 * textlen. The result is a much better compression on repositories that have many concurrent branches. Here are a comparison between using deltas from current upstream (aggressive-merge-deltas on by default) and deltas from a sparse-revlog Comparison of `.hg/store/` size: mercurial (6.74% merges): before: 46,831,873 bytes after: 46,795,992 bytes (no relevant change) pypy (8.30% merges): before: 333,524,651 bytes after: 308,417,511 bytes -8% netbeans (34.21% merges): before: 1,141,847,554 bytes after: 1,131,093,161 bytes -1% mozilla-central (4.84% merges): before: 2,344,248,850 bytes after: 2,328,459,258 bytes -1% large-private-repo-A (merge 19.73%) before: 41,510,550,163 bytes after: 8,121,763,428 bytes -80% large-private-repo-B (23.77%) before: 58,702,221,709 bytes after: 8,351,588,828 bytes -76% Comparison of `00manifest.d` size: mercurial (6.74% merges): before: 6,143,044 bytes after: 6,107,163 bytes pypy (8.30% merges): before: 52,941,780 bytes after: 27,834,082 bytes -48% netbeans (34.21% merges): before: 130,088,982 bytes after: 119,337,636 bytes -10% mozilla-central (4.84% merges): before: 215,096,339 bytes after: 199,496,863 bytes -8% large-private-repo-A (merge 19.73%) before: 33,725,285,081 bytes after: 390,302,545 bytes -99% large-private-repo-B (23.77%) before: 49,457,701,645 bytes after: 1,366,752,187 bytes -97% The better delta chains provide a performance boost in relevant repositories: pypy, bundling 1000 revisions: before: 1.670s after: 1.149s -31% Unbundling got a bit slower. probably because the sparse algorithm is still pure python. pypy, unbundling 1000 revisions: before: 4.062s after: 4.507s +10% Performance of bundle/unbundle in repository with few concurrent branches (eg: mercurial) are unaffected. No significant differences have been noticed then timing `hg push` and `hg pull` locally. More state timings are being gathered. Same as for aggressive-merge-delta, better delta comes with longer delta chains. Longer chains have a performance impact. For example. The length of the chain needed to get the manifest of pypy's tip moves from 82 item to 1929 items. This moves the restore time from 3.88ms to 11.3ms. Delta chain length is an independent issue that affects repository without this changes. It will be dealt with independently. No significant differences have been observed on repositories where `sparse-revlog` have not much effect (mercurial, unity, netbeans). On pypy, small differences have been observed on some operation affected by delta chain building and retrieval. pypy, perfmanifest before: 0.006162s after: 0.017899s +190% pypy, commit: before: 0.382 after: 0.376 -1% pypy, status: before: 0.157 after: 0.168 +7% More comprehensive and stable timing comparisons are in progress.
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: