如何在命令行中跨多个外部进行单个SVN提交?

时间:2022-07-09 04:37:50

This may be impossible, but I'm going to ask anyway.

这可能是不可能的,但无论如何我都会问。

Without going into the details of why it's like this, I have two primary checkouts that I work in, one for the production release branch, and one for trunk. Each of them is a small collection of svn:externals references to sub-projects, with no direct content under the checked-out svn directory.

没有详细说明为什么会这样,我有两个主要的结账工作,一个用于生产发布分支,一个用于主干。它们中的每一个都是对子项目的svn:externals引用的一小部分,在签出的svn目录下没有直接内容。

That is, the four svn:externals directives add all of the content in each of the checkout directories.

也就是说,四个svn:externals指令添加每个结帐目录中的所有内容。

When I do a commit via Eclipse(/Subclipse) I can commit changes across all of the external projects in one go, which is good because they're just separate sub-projects in the same repository and this allows me to avoid doing 4 separate commits in a row to the same repo.

当我通过Eclipse(/ Subclipse)进行提交时,我可以一次性提交所有外部项目的更改,这很好,因为它们只是在同一个存储库中的单独子项目,这使我可以避免单独执行4个项目连续提交到同一个回购。

Is it not possible to do the same thing from the command line? Commits for each of the externals could certainly be scripted and aliased to one command, but I'd rather avoid cluttering the commit log with separate commits for related changes if possible.

是不是可以从命令行做同样的事情?每个外部的提交肯定可以编写脚本并别名为一个命令,但是如果可能的话,我宁愿避免使用相应更改的单独提交来混淆提交日志。

6 个解决方案

#1


Unfortunately, your assumption was correct. The current subversion command line tool will not recurse into disjointed externals working copies during a commit. Eclipse probably figures out that it's all rooted the same and adjusts everything so that it's only doing a single commit transaction.

不幸的是,你的假设是正确的。当前的subversion命令行工具在提交期间不会递归到脱节的外部工作副本。 Eclipse可能会发现它全部都是相同的并且调整了所有内容,因此它只执行一次提交事务。

This drawback of the client is actually listed as one of the issues to watch out for when defining externals in your project. As of the 1.6.1 client, this limitation still exists.

客户端的这个缺点实际上被列为在项目中定义外部时需要注意的问题之一。从1.6.1客户端开始,此限制仍然存在。

#2


You can specify all files and folders you want to commit in the command line client, including the externals. Since the CL doesn't recurse into externals, you have to specify those in your commit command separately:

您可以在命令行客户端中指定要提交的所有文件和文件夹,包括外部。由于CL不会递归到外部,因此您必须分别在commit命令中指定它们:

svn ci working_copy externals1 externals2 -m "log message"

Haven't tried this though. If it doesn't work, you have to specify all the modified files and folders separately, not just the 'root' folders of the externals.

虽然没试过这个。如果它不起作用,则必须单独指定所有已修改的文件和文件夹,而不仅仅指定外部的“根”文件夹。

#3


With the latest SVN you can do: --include-externals

使用最新的SVN,您可以: - include-externals

#4


If you only have content and no attribute modifications, you can do something along:

如果您只有内容而没有属性修改,您可以执行以下操作:

svn st | egrep "^M" | awk '{print $2}' | xargs svn ci -m 'your message'

If you have added/deleted, ... files, you might modify the egrep regex to fit your needs.

如果您添加/删除了......文件,则可以修改egrep正则表达式以满足您的需要。

#5


I iterate over all externals, and execute "svn commit" on each, such as:

我遍历所有外部,并在每个外部执行“svn commit”,例如:

for dir in $(svn propget svn:externals . | awk '{print $2}'); do svn commit $dir; done

#6


You can do:

你可以做:

svn ci -m"my comment" *

#1


Unfortunately, your assumption was correct. The current subversion command line tool will not recurse into disjointed externals working copies during a commit. Eclipse probably figures out that it's all rooted the same and adjusts everything so that it's only doing a single commit transaction.

不幸的是,你的假设是正确的。当前的subversion命令行工具在提交期间不会递归到脱节的外部工作副本。 Eclipse可能会发现它全部都是相同的并且调整了所有内容,因此它只执行一次提交事务。

This drawback of the client is actually listed as one of the issues to watch out for when defining externals in your project. As of the 1.6.1 client, this limitation still exists.

客户端的这个缺点实际上被列为在项目中定义外部时需要注意的问题之一。从1.6.1客户端开始,此限制仍然存在。

#2


You can specify all files and folders you want to commit in the command line client, including the externals. Since the CL doesn't recurse into externals, you have to specify those in your commit command separately:

您可以在命令行客户端中指定要提交的所有文件和文件夹,包括外部。由于CL不会递归到外部,因此您必须分别在commit命令中指定它们:

svn ci working_copy externals1 externals2 -m "log message"

Haven't tried this though. If it doesn't work, you have to specify all the modified files and folders separately, not just the 'root' folders of the externals.

虽然没试过这个。如果它不起作用,则必须单独指定所有已修改的文件和文件夹,而不仅仅指定外部的“根”文件夹。

#3


With the latest SVN you can do: --include-externals

使用最新的SVN,您可以: - include-externals

#4


If you only have content and no attribute modifications, you can do something along:

如果您只有内容而没有属性修改,您可以执行以下操作:

svn st | egrep "^M" | awk '{print $2}' | xargs svn ci -m 'your message'

If you have added/deleted, ... files, you might modify the egrep regex to fit your needs.

如果您添加/删除了......文件,则可以修改egrep正则表达式以满足您的需要。

#5


I iterate over all externals, and execute "svn commit" on each, such as:

我遍历所有外部,并在每个外部执行“svn commit”,例如:

for dir in $(svn propget svn:externals . | awk '{print $2}'); do svn commit $dir; done

#6


You can do:

你可以做:

svn ci -m"my comment" *