Skip to contentSkip to conversation

git-svnimport: added explicit merge graph option -G

PATCH Stas Maximov 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

Hi Junio,

Thank you for a thorough review and good suggestions. New cumulative patch is pasted and attached.

Quoted 14 lines

From: Junio C Hamano <[email protected]>
...

Quoted 12 lines
(quoted diff) +11 -0
+# Given an SVN revision (string), returns all corresponding GIT revisions.
+#
+# Note that it is possible that one SVN revision needs to be split into two or
+# more GIT commits (revision). For example, this will happen if SVN user
+# commits two branches at once.
+sub svnrev_to_gitrevs($)
...
+    my $svnrev = shift;
+    my @gitrevs;
+    for my $b (keys(%branches)) {
+        push (@gitrevs, $branches{$b}{$svnrev})
+            if defined($branches{$b}{$svnrev});
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+    }
+    return @gitrevs;
+}

Hmph. The computation cost for this is proportional to the number of branches on the SVN side? Would that be a problem in real-life (not an objection, but am just wondering. "Not a problem, because..." is an acceptable answer).

I chose not to add and maintain an inverted data structure in parallel to %branches for simplicity.

Stas.

Quoted 1 line

From b17c89b82441dc3c5dc3155acee560a1d7f0149d Mon Sep 17 00:00:00 2001

From: Stas Maximov <[email protected]>
Date: Mon, 25 Jun 2007 09:18:35 -0700
Subject: [PATCH] git-svnimport: added explicit merge graph option -G

Allows explicit merge graph information to be provided. Each line of merge graph file must contain a pair of SVN revision numbers separated by space. The first number is child (merged to) SVN rev number and the second is the parent (merged from) SVN rev number. Comments can be started with '#' and continue to the end of line. Empty and space-only lines are allowed and will be ignored.

---
 Documentation/git-svnimport.txt |   11 +++++-
 git-svnimport.perl              |   74 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 4 deletions(-)
Documentation/git-svnimport.txt +10 -1
index e97d15e..c902b64 100644
@@ -13,7 +13,8 @@ SYNOPSIS
 'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
         [ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
         [ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
-        [ -s start_chg ] [ -m ] [ -r ] [ -M regex ]
+        [ -s start_chg ] [ -r ]
+        [ -m ] [ -M regex ] [-G merge_graph_file ]
         [ -I <ignorefile_name> ] [ -A <author_file> ]
         [ -R <repack_each_revs>] [ -P <path_from_trunk> ]
         <SVN_repository_URL> [ <path> ]
@@ -102,6 +103,14 @@ repository without -A.
     regex. It can be used with -m to also see the default regexes.
     You must escape forward slashes.
 
+-G <merge_graph_file>::
+    Allows explicit merge graph information to be provided. Each line
+    of merge graph file must contain a pair of SVN revision numbers
+    separated by space. The first number is child (merged to) SVN rev
+    number and the second is the parent (merged from) SVN rev number.
+    Comments can be started with '#' and continue to the end of line.
+    Empty and space-only lines are allowed and will be ignored.
+
 -l <max_rev>::
     Specify a maximum revision number to pull.
 +
git-svnimport.perl +71 -3

108 lines not on this page · raw message

Signature · 1 line
1.5.1.3

From b17c89b82441dc3c5dc3155acee560a1d7f0149d Mon Sep 17 00:00:00 2001
From: Stas Maximov <[email protected]>
Date: Mon, 25 Jun 2007 09:18:35 -0700
Subject: [PATCH] git-svnimport: added explicit merge graph option -G

Allows explicit merge graph information to be provided. Each line of merge graph file must contain a pair of SVN revision numbers separated by space. The first number is child (merged to) SVN rev number and the second is the parent (merged from) SVN rev number. Comments can be started with '#' and continue to the end of line. Empty and space-only lines are allowed and will be ignored.

---
 Documentation/git-svnimport.txt |   11 +++++-
 git-svnimport.perl              |   74 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 4 deletions(-)
Documentation/git-svnimport.txt +10 -1
index e97d15e..c902b64 100644
@@ -13,7 +13,8 @@ SYNOPSIS
 'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
 		[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
 		[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
-		[ -s start_chg ] [ -m ] [ -r ] [ -M regex ]
+		[ -s start_chg ] [ -r ]
+		[ -m ] [ -M regex ] [-G merge_graph_file ]
 		[ -I <ignorefile_name> ] [ -A <author_file> ]
 		[ -R <repack_each_revs>] [ -P <path_from_trunk> ]
 		<SVN_repository_URL> [ <path> ]
@@ -102,6 +103,14 @@ repository without -A.
 	regex. It can be used with -m to also see the default regexes.
 	You must escape forward slashes.
 
+-G <merge_graph_file>::
+	Allows explicit merge graph information to be provided. Each line
+	of merge graph file must contain a pair of SVN revision numbers
+	separated by space. The first number is child (merged to) SVN rev
+	number and the second is the parent (merged from) SVN rev number.
+	Comments can be started with '#' and continue to the end of line.
+	Empty and space-only lines are allowed and will be ignored.
+
 -l <max_rev>::
 	Specify a maximum revision number to pull.
 +
git-svnimport.perl +71 -3

108 lines not on this page · raw message

Signature · 1 line
1.5.1.3