Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

(NOTE: Also asked on stackoverflow.com - http://stackoverflow.com/questions/4604365/script-tool-to-import-series-of-snapshots-each-being-a-new-revision-into-subver since programmers includes subjective discussions where as stackoverflow.com is for precise question and answers (according to official comparison of sites (http://meta.programmers.stackexchange.com/questions/171/whats-the-difference-between-programmers-and-so) ).

I've developed code locally and taken a fairly regular snapshot whenever I reach a significant point in development, e.g. a working build.

So I have a long-ish list of about 40 folders, each folder being a snapshot e.g. in ascending date YYYYMMDD order, e.g.:-

  1. 20100523
  2. 20100614
  3. 20100721
  4. 20100722
  5. 20100809
  6. 20100901
  7. 20101001
  8. 20101003
  9. 20101104
  10. 20101119
  11. 20101203
  12. 20101218
  13. 20110102

I'm looking for a script to import each of these snapshots as a new subversion revision to the source tree. The end result being that the HEAD revision is the same as the last snapshot, and other revisions are as numbered.

Some other requirements:

  • that the HEAD revision is not cumulative of the previous snapshots, i.e., files that appeared in older snapshots but which don't appear in later ones (e.g. due to refactoring etc.) should not appear in the HEAD revision.
  • meanwhile, there should be continuity between files that do persist between snapshots. Subversion should know that there are previous versions of these files and not treat them as brand new files within each revision.

Some background about my aim:

  • I need to formally revision control this work rather than keep local private snapshot copies.
  • I plan to release this work as open source, so version controlling would be highly recommended
  • I am evaluating some of the current popular version control systems (Subversion and GIT) BUT I definitely need a working solution in Subversion. I'm not looking to be persuaded to use one particular tool, I need a solution for each tool I am considering as I would also like a solution in GIT (I will post an answer separately for GIT so separate camps of folks who have expertise in GIT and Subversion will be able to give focused answers on one or the other).

The same question but for GIT: Script/tool to import series of snapshots, each being a new edition, into GIT, populating source tree?

An outline answer for Subversion in stackoverflow.com but not enough specifics about the script: what commands to use, code to check valid scenarios if necessary - i.e. a working script basically. http://stackoverflow.com/questions/2203818/is-there-anyway-to-import-xcode-snapshots-into-a-new-svn-repository

share|improve this question
1  
Having 2 nearly identical questions back to back probably won't get you very good answers to both. I suggest that you edit one of the questions and delete the other (or we can do that for you). –  Walter Jan 5 '11 at 14:03
    
@Walter they are deliberately separate as they are for 2 different version control systems. I deliberately separated them to give different groups of folks a chance to apply their expertise to each, to increase the chances of an accepted answer, though I know on programmers this site is deliberately open-ended for question answering as the official notes say. By having them separate means that folks with specific expertise on one of the version control systems would more likely get an accepted answer. I suppose I'm applying the principle of software cohesion to the questions: one purpose. –  therobyouknow Jan 6 '11 at 16:42
    
Anyway I've found an answer to my own question for Subversion after a bit more digging on my part on the svnforum.org which I am happy to share here. @Vonc very kindly answered the GIT version of the question, so we are all good now :) –  therobyouknow Jan 6 '11 at 16:43
add comment

closed as off topic by ChrisF May 1 '13 at 9:59

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

There is already a standard tool available to do this job:

svn_load_dirs.pl

As stated as a solution to question in SVN Forum post "Import 50 manual full-backups": http://www.svnforum.org/2017/viewtopic.php?t=5292

and

In SVN Forum question "Importing New Code into Repository": http://www.svnforum.org/2017/viewtopic.php?t=4859

I expect to accept this, my own answer to my question.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.