summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42a3217)
raw | patch | inline | side by side (parent: 42a3217)
author | Alex Bennee <kernel-hacker@bennee.com> | |
Thu, 18 Oct 2007 16:15:44 +0000 (17:15 +0100) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 19 Oct 2007 00:51:16 +0000 (20:51 -0400) |
CVS gets understandably upset if you try and add a subdirectory
before it's parent directory. This patch fixes that.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
before it's parent directory. This patch fixes that.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-cvsexportcommit.perl | patch | blob | history |
index a33fa8d4c86da54a4d741cf921d1cf7b2138d186..7b19a33ad1cceaf61793be4e16e4b144d415a975 100755 (executable)
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
+
+#
+# We have to add the directories in order otherwise we will have
+# problems when we try and add the sub-directory of a directory we
+# have not added yet.
+#
+# Luckily this is easy to deal with by sorting the directories and
+# dealing with the shortest ones first.
+#
+@dirs = sort { length $a <=> length $b} @dirs;
+
foreach my $d (@dirs) {
if (system(@cvs,'add',$d)) {
$dirtypatch = 1;