开发者

How do I delete files based on subversion?

开发者 https://www.devze.com 2023-03-28 10:01 出处:网络
I have a folder named \"y\", that is not kept in version control. I have a folder \"x\" that is under version control. I want to copy y into x, because then I can use Tortoisesvn Check for Modificatio

I have a folder named "y", that is not kept in version control. I have a folder "x" that is under version control. I want to copy y into x, because then I can use Tortoisesvn Check for Modifications command on folder x

I can then assume that every file/folder that reads Non-versioned or Ignored can safely be deleted. Since my WC has been working fine for a year without them.

How do I get a list of files marked by Subversion as added to create my batch script?

Update.

I've gotten pretty far, I think I just need a way to automate this.

I copied y into x. I ran check for modifications. I can right click the dialog and copy paths to clipboard. I only select the Unversioned or ignored files.

I paste the paths into a batch file. I use some find and replace magic to create this.

XCOPY www.root\* www.root.backup /I /Q /R /S /E
CD www.root
DEL "Appraisals\*.*" /q /s
DEL "jobs\Backup\*.*" /q /s
DEL "New\Portability\BACKUP\*.*" /q /s
DEL "Footer\Codes\*.*" /q /s
DEL "QL\Commercial\*.*" /q /s
DEL "images\Discard\*.*" /q /s
DEL "Dup SH Pages\*.*" /q /s
DEL "ExtensionRequest\*.*" /q /s
DEL "ExtFile\*.*" /q /s
DEL "Ad\Include\*.*" /q /s
DEL "Bio\Include\*.*" /q /s
DEL "Contact\Include\*.*" /q /s

Update #2

I work better with analogies and examples, so here is the scenario and what I want the outcome to be.

Please imagine I have the a very simple trunk in my repo. It has only one file code.txt I make my changes to that file, commit them back to the repo. After changes are commited to the repo I export only this file from the repo to Production.

Now imagine some other developers come along and don't talk to me. They copy directly out to the production server all kinds of files.

copy of code.txt

bob's copy of code.txt_backup

copy of copy of copy of bob's copy of code.txt_backup.backup

Now Imagine, I realize this, and decide to protect thei开发者_JAVA百科r code in subverion. I add it to my repo and commit. Now over time I realize that copy of copy of copy of bob's copy of code.txt_backup.backup is actually part of production and the other two files are garbage.

I delete the files copy of code.txt,bob's copy of code.txt_backup from my WC and commit. I also make a tiny change to code.txt. I commit.

Now when I compare to previous revision and do an export Tortoise will export the changed file(s).

So Now I have two files orphaned on production. I want a script to delete them from production based on the fact that they are not in the HEAD of Subversion.

Now imagine if you had 5300 files and folders. ....Whew.


If I understand your issue correctly, you only need to copy the content of y into checked-out x.

Then, open x with windows explorer. Since you have tortoise svn installed on your PC, the files not under version will be flagged with a blue icon, those modified with a red icon and those not modified with a green icon.

Is that what you are looking for?

EDIT

I just had another idea:

  1. Create a copy of Y.
  2. Loop through all files f of X.
  3. Delete all f in Y.

In the end Y will contain the files not in X, which is what you want, no? Then you can delete them from X after adding Y to X.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号