summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 19:14:29 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 19:27:29 +0100
commit3bfa1c7b9601a6ed2f11c5bd5f7d2e52f6c6dc1c (patch)
tree15a97f1a85071100ff7220c6a2536477dfd89320 /dgit
parent894b4c7356a3421b78afd3bb7cf074a62ef97ce5 (diff)
New import: Import: Add a lot of debugging
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit18
1 files changed, 18 insertions, 0 deletions
diff --git a/dgit b/dgit
index e05c574..8b39bf1 100755
--- a/dgit
+++ b/dgit
@@ -1711,8 +1711,11 @@ sub generate_commits_from_dsc () {
my $clogp;
my $r1clogp;
+ printdebug "import clog search...\n";
+
for (;;) {
my $stanzatext = do { local $/=""; <CLOGS>; };
+ printdebug "import clogp ".Dumper($stanzatext) if $debuglevel>1;
last if !defined $stanzatext;
my $desc = "package changelog, entry no.$.";
@@ -1720,6 +1723,8 @@ sub generate_commits_from_dsc () {
my $thisstanza = parsecontrolfh $stanzafh, $desc, 1;
$clogp //= $thisstanza;
+ printdebug "import clog $thisstanza->{version} $desc...\n";
+
last if !$any_orig; # we don't need $r1clogp
# We look for the first (most recent) changelog entry whose
@@ -1744,8 +1749,12 @@ sub generate_commits_from_dsc () {
# versions were created in a non-monotic order rather than
# that the changelog entries have been misordered.
+ printdebug "import clog $thisstanza->{version} vs $upstreamv...\n";
+
last if version_compare($thisstanza->{version}, $upstreamv) < 0;
$r1clogp = $thisstanza;
+
+ printdebug "import clog $r1clogp->{version} becomes r1\n";
}
die $! if CLOGS->error;
close CLOGS or $?==(SIGPIPE<<8) or failedcmd @clogcmd;
@@ -1762,7 +1771,12 @@ sub generate_commits_from_dsc () {
# Strictly, r1authline might now be wrong if it's going to be
# unused because !$any_orig. Whatever.
+ printdebug "import tartrees authline $authline\n";
+ printdebug "import tartrees r1authline $r1authline\n";
+
foreach my $tt (@tartrees) {
+ printdebug "import tartree $tt->{F} $tt->{Tree}\n";
+
$tt->{Commit} = make_commit_text($tt->{Orig} ? <<END_O : <<END_T);
tree $tt->{Tree}
author $r1authline
@@ -1783,6 +1797,8 @@ END_T
}
}
+ printdebug "import main commit\n";
+
open C, ">../commit.tmp" or die $!;
print C <<END or die $!;
tree $tree
@@ -1803,6 +1819,8 @@ END
my $rawimport_hash = make_commit qw(../commit.tmp);
if (madformat $dsc->{format}) {
+ printdebug "import apply patches...\n";
+
# regularise the state of the working tree so that
# the checkout of $rawimport_hash works nicely.
my $dappliedcommit = make_commit_text(<<END);