用于将一系列快照(每个都是新修订版)导入 Subversion 并填充源代码树的脚本/工具?

发布于 2024-10-10 14:42:25 字数 1896 浏览 2 评论 0原文

我在本地开发了代码,并且每当我达到开发的重要阶段(例如工作构建)时都会定期拍摄快照。

所以我有一个大约 40 个文件夹的长列表,每个文件夹都是一个快照,例如按日期 YYYYMMDD 升序排列,例如:-

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

我正在寻找要导入的脚本这些快照中的每一个都是对源树的新的颠覆修订。最终结果是 HEAD 修订版与上一个快照相同,其他修订版编号相同。

其他一些要求:

  • HEAD 修订版不是先前快照的累积,即出现在旧快照中但未出现在以后快照中(例如由于重构等)的文件不应出现在 HEAD 修订版中。
  • 同时,在快照之间持续存在的文件之间应该存在连续性。 Subversion 应该知道这些文件有以前的版本,而不是在每个修订版中将它们视为全新文件。

关于我的目标的一些背景:

  • 我需要正式修订控制这项工作,而不是保留本地私有快照副本。
  • 我计划将这项工作作为开源发布,因此强烈建议进行版本控制。
  • 我正在评估一些当前流行的版本控制系统(Subversion 和 GIT),但我绝对需要 Subversion 中的一个可行的解决方案。我希望被说服使用一种特定的工具,我需要为我正在考虑的每个工具提供一个解决方案,因为我也希望在 GIT 中找到一个解决方案(我将单独为 GIT 发布一个答案,以便拥有 GIT 和 Subversion 专业知识的不同阵营的人将能够针对其中之一给出有针对性的答案)。

同样的问题,但对于 GIT [在programmers.stackexchange.com 中回答]: https://softwareengineering.stackexchange.com/questions/33868/script-tool-to-import-series-of-snapshots-each-being-a-new-edition-into-git-po

概要答案对于 stackoverflow.com 中的 Subversion,但有关脚本的细节不够:使用哪些命令、必要时检查有效场景的代码 - 即基本上是一个工作脚本。 是否可以将 XCode 快照导入一个新的 SVN 存储库?

最初发布在programmers.stackexchange.com,但在这里发布,因为程序员包含主观讨论,而 stackoverflow.com 则提供精确的问题和答案(根据网站的官方比较(http://meta.programmers.stackexchange.com/questions/171/程序员和程序员之间的区别是什么) )。

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 [Answered in programmers.stackexchange.com]:
https://softwareengineering.stackexchange.com/questions/33868/script-tool-to-import-series-of-snapshots-each-being-a-new-edition-into-git-po

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. Is there anyway to import XCode snapshots into a new SVN repository?

(Originally posted in programmers.stackexchange.com but published here 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) ).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷雨优美回忆 2024-10-17 14:42:25

已经有一个标准工具可以完成这项工作:

svn_load_dirs.pl

正如 SVN 论坛帖子“导入 50 个手动完整备份”中问题的解决方案所述:http://www.svnforum.org/2017/viewtopic.php?t=5292

SVN 论坛问题“将新代码导入存储库”:< a href="http://www.svnforum.org/2017/viewtopic.php?t=4859" rel="nofollow">http://www.svnforum.org/2017/viewtopic.php?t=4859< /a>

我希望接受这个,我自己对我的问题的回答。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文