<commit_before>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'pvn/io/element'
require 'pvn/subcommands/pct/options'
require 'pvn/subcommands/base/command'
require 'svnx/info/command'
require 'svnx/status/command'
require 'svnx/cat/command'
require 'pvn/subcommands/pct/diffcount'
require 'set'

module PVN::Subcommands::Pct
  class Command < PVN::Subcommands::Base::Command

    DEFAULT_LIMIT = 15

    subcommands [ "pct" ]
    description "Compares revisions as a percentage of lines modified."
    usage       "[OPTIONS] FILE..."
    summary   [ "Compares to revisions, showing the changes in the size (length)",
                "of files that have been modified in the latter revision, to",
                "show the extent to which they have increased or decreased.",
                "The columns are:",
                " - length in svn repository",
                " - length in local version",
                " - difference",
                " - percentage change",
                " - file name",
                "The total numbers are displayed as the last line.",
                "Added and deleted files are not included." ]
    
    optscls

    example "pvn pct foo.rb",       "Prints the changes in foo.rb, working copy against BASE."
    example "pvn pct -r114:121",    "Prints the changes for all files, revision 114 against 121. (not yet supported)"
    example "pvn pct -rHEAD",       "Prints the changes, working copy against HEAD. (not yet supported)"
    example "pvn pct -r117",        "Prints the changes between revision 117 and the previous revision. (not yet supported)"
    example "pvn pct -7",           "Prints the changes between relative revision -7 and the previous revision. (not yet supported)"
    example "pvn pct -r31 -4",      "Prints the changes between revision 31 and relative revision -4. (not yet supported)"

    class << self
      # base command aliases new to init, so we're aliasing init to init2
      alias_method :init2, :init

      def init options
        if options.revision && !options.revision.empty?
          CommandRepository.init2 options
        else
          CommandLocal.init2 options
        end
      end
    end

    def initialize options = nil
    end

    def show_diff_counts options
      paths = options.paths<commit_msg>Fixed descriptions of pct subcommand, since nearly all comparisons are supported now.<commit_after>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'pvn/io/element'
require 'pvn/subcommands/pct/options'
require 'pvn/subcommands/base/command'
require 'svnx/info/command'
require 'svnx/status/command'
require 'svnx/cat/command'
require 'pvn/subcommands/pct/diffcount'
require 'set'

module PVN::Subcommands::Pct
  class Command < PVN::Subcommands::Base::Command

    DEFAULT_LIMIT = 15

    subcommands [ "pct" ]
    description "Compares revisions as a percentage of lines modified."
    usage       "[OPTIONS] FILE..."
    summary   [ "Compares to revisions, showing the changes in the size (length)",
                "of files that have been modified in the latter revision, to",
                "show the extent to which they have increased or decreased.",
                "The columns are:",
                " - length in svn repository",
                " - length in local version",
                " - difference",
                " - percentage change",
                " - file name",
                "The total numbers are displayed as the last line.",
                "Added and deleted files are not included." ]
    
    optscls

    example "pvn pct foo.rb",       "Prints the changes in foo.rb, working copy against BASE."
    example "pvn pct -r114:121",    "Prints the changes for all files, revision 114 against 121."
    example "pvn pct -rHEAD",       "Prints the changes, working copy against HEAD. (not yet supported)"
    example "pvn pct -r117",        "Prints the changes between revision 117 and the previous revision."
    example "pvn pct -7",           "Prints the changes between relative revision -7 and the previous revision."
    example "pvn pct -r31 -4",      "Prints the changes between revision 31 and relative revision -4."

    class << self
      # base command aliases new to init, so we're aliasing init to init2
      alias_method :init2, :init

      def init options
        if options.revision && !options.revision.empty?
          CommandRepository.init2 options
        else
          CommandLocal.init2 options
        end
      end
    end

    def initialize options = nil
    end

    def show_diff_counts options
      paths = options.paths
{'fraction_non_alphanumeric': 0.08686163247490179, 'fraction_numerical': 0.013967699694456569, 'mean_word_length': 2.328249818445897, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5880709', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1204, 'n_words': 484}