Including new files in SVN diff

后端 未结 2 1117
无人及你
无人及你 2021-02-01 03:09

I have a script which builds my application, uploads it to a remote machine, runs a performance test there and captures some metrics that I care about. The script creates a patc

2条回答
  •  [愿得一人]
    2021-02-01 03:31

    To make svn diff include all the unversioned files from your local working copy you have to add these files first. svn diff outputs the same changeset that svn commit would use.

    If you know for sure that all unversioned files should be added here's what you could do.

    Prepare a list of unversioned files by taking from the output of svn status all the lines that start with a question mark:

    svn status | grep ^? | sed -r 's/^\? +//' > ../unversioned_files_list.txt
    

    You can then pass that list of files to svn addusing xargs:

    xargs -r -d '\n' svn add < ../unversioned_files_list.txt
    

    And then produce the patch:

    svn diff > ../my_patch.patch
    

    If you don't want to keep those files added, use the list of files to unadd them:

    xargs -r -d '\n' svn rm --keep-local < ../unversioned_files_list.txt
    

提交回复
热议问题