The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Remove files that are not in subversion

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Gross

Posts: 152
Nickname: pgross
Registered: Sep, 2007

Paul Gross is a software developer for ThoughtWorks.
Remove files that are not in subversion Posted: Jan 22, 2008 7:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Paul Gross.
Original Post: Remove files that are not in subversion
Feed Title: Paul Gross's Blog - Home
Feed URL: http://feeds.feedburner.com/pgrs
Feed Description: Posts mainly about ruby on rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Paul Gross
Latest Posts From Paul Gross's Blog - Home

Advertisement

One of the great features of version control is that I can easily revert back to a known good state. I can do this in Subversion with the following command:

% svn revert -R .

However, if I have new files that are not in Subversion, this command will not delete them. Here is a fun ruby one liner to remove those files:

svn st | ruby -ne 'File.delete($_[1..-1].strip) if $_.match(/^\?/)'

This command loops over svn status and deletes all files from lines that start with ?.

Read: Remove files that are not in subversion

Topic: Vista, ping and English Previous Topic   Next Topic Topic: What's Happening With IronRuby?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use