Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2099

Cannot display diff result for true text file with binary mark



    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.2.0
    • Component/s: cmdline client
    • Labels:


      As of issue 2065, sometimes there are some document formats that are not
      registered as a text/* document, but IS actually text files, especially for some
      XML document formats.  For example, the ABNF document (one of the grammar format
      for VoiceXML) I used in issue 2065 is registered in IETF with the MIME type,
      application/srgs, but is actually a text file.
      When I try to svn diff this kind of document, svn deny to display the diff result
      due to the mime-type check:
      SHELL> svn porplist foo.gram
      Properties on 'foo.gram':
        svn:mime-type : application/srgs
        svn:keywords : Id LastChangedDate LastChangedRevision LastChangedBy HeadURL
      SHELL> % echo ' ' >> foo.gram
      SHELL> % svn diff foo.gram
      Index: foo.gram
      Cannot display: file marked as a binary type.
      svn:mime-type = application/srgs
      Of course, like issue 2065, we can work around the blocking by clear
      svn:mime-type property, do diff, then set svn:mime-type back.  But this is
      absolutely not a good way.  Maybe a better solution is to provide a --force
      option to svn diff to force the output of binary diff result, since there's no
      such option currently:
      SHELL> svn help diff
      diff (di): Display the differences between two paths.
      usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH...]
             2. diff -r N:M URL
             3. diff [-r N[:M]] URL1[@N] URL2[@M]
        1. Display the differences between OLD-TGT and NEW-TGT.  PATHs, if
           given, are relative to OLD-TGT and NEW-TGT and restrict the output
           to differences for those paths.  OLD-TGT and NEW-TGT may be working
           copy paths or URL[@REV].
           OLD-TGT defaults to the path '.' and NEW-TGT defaults to OLD-TGT.
           N defaults to BASE or, if OLD-TGT is an URL, to HEAD.
           M defaults to the current working version or, if NEW-TGT is an URL,
           to HEAD.
           '-r N' sets the revision of OLD-TGT to N, '-r N:M' also sets the
           revision of NEW-TGT to M.
        2. Shorthand for 'svn diff -r N:M --old=URL --new=URL'.
        3. Shorthand for 'svn diff [-r N[:M]] --old=URL1 --new=URL2'
        Use just 'svn diff' to display local modifications in a working copy
      Valid options:
        -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                                   A revision argument can be one of:
                                      NUMBER       revision number
                                      "{" DATE "}" revision at start of the date
                                      "HEAD"       latest in repository
                                      "BASE"       base rev of item's working copy
                                      "COMMITTED"  last commit at or before BASE
                                      "PREV"       revision just before COMMITTED
        --old arg                : use ARG as the older target
        --new arg                : use ARG as the newer target
        -x [--extensions] arg    : pass ARG as bundled options to GNU diff
        -N [--non-recursive]     : operate on single directory only
        --diff-cmd arg           : use ARG as diff command
        --no-diff-deleted        : do not print differences for deleted files
        --notice-ancestry        : notice ancestry when calculating differences
        --username arg           : specify a username ARG
        --password arg           : specify a password ARG
        --no-auth-cache          : do not cache authentication tokens
        --non-interactive        : do no interactive prompting
        --config-dir arg         : read user configuration files from directory ARG

      Original issue reported by jeffhung




            • Assignee:
              subversion-importer Subversion Importer
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: