How to escape @ characters in Subversion managed file names?

后端 未结 11 1310
不知归路
不知归路 2020-11-28 01:49

For many Subversion operations, appending the \'@\' symbol to the end of a file or URL argument allows you to target a specific revision of that file. For example, \"svn in

相关标签:
11条回答
  • 2020-11-28 02:12

    @David H

    I just tried a similar command without escaping the @ symbols and it still works fine

    svn ci splash.png splash@2x.png@
    

    This is on GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0) and svn 1.6.16

    0 讨论(0)
  • 2020-11-28 02:14

    In my case I needed to remove files from a SVN repo that contained an @ sign:

    This wouldn't work:

    svn remove 'src/assets/images/hi_res/locales-usa@2x.png'
    

    But this did:

    svn remove 'src/assets/images/hi_res/locales-usa@2x.png@'
    
    0 讨论(0)
  • 2020-11-28 02:14

    For svn commands with 2 arguments like "move", you must append "@" only at left (first) parameter. For example:

    $ svn add README@txt@
    A         README@txt
    
    $ svn move README@txt@ README2@txt
    A         README2@txt
    D         README@txt
    
    
    $ svn status
    A       README2@txt
    
    $ svn commit -m "blah"
    Adding         README2@txt
    Transmitting file data .
    Committed revision 168.
    
    $ svn delete README2@txt@
    D         README2@txt
    
    $ svn commit -m "blahblah"
    *Deleting       README2@txt
    
    Committed revision 169.
    

    This line is important: $ svn move README@txt@ README2@txt

    As you can see, we don't need to append "@" at "README2@txt"

    0 讨论(0)
  • 2020-11-28 02:18

    To add multiple files, there is alternative solution:

    svn status | grep \.png | awk '{print $2"@"}'| xargs svn add
    
    0 讨论(0)
  • 2020-11-28 02:19

    The only solution that worked for me was the same suggested by @NPike

    svn revert 'path/to/filename@ext@'

    0 讨论(0)
提交回复
热议问题