chiark / gitweb /
working on updates for new theory/metadata
[topbloke.git] / tb-create.pl
index a3fd1b37e6c86d23288d19ee84616eece18a8692..b01010b8333172c0af35bcf60b0ce0d910a3e83c 100755 (executable)
@@ -1,12 +1,16 @@
 #!/usr/bin/perl
 # usage: tb-create <patch-spec>
 
 #!/usr/bin/perl
 # usage: tb-create <patch-spec>
 
+xxx needs updating for new metadata and new theory
+
 use warnings;
 use strict;
 
 use Getopt::Long;
 use Topbloke;
 
 use warnings;
 use strict;
 
 use Getopt::Long;
 use Topbloke;
 
+fixme needs update to new metadata;
+
 Getopt::Long::Configure(qw(bundling));
 
 die "bad usage\n" unless @ARGV==1;
 Getopt::Long::Configure(qw(bundling));
 
 die "bad usage\n" unless @ARGV==1;
@@ -77,9 +81,10 @@ setup_config();
 
 #----- subroutines for setup
 
 
 #----- subroutines for setup
 
-sub create_and_switch ($) {
-    my ($branchref) = @_;
-    run_git(qw(update-ref -m), "tb-create base", $branchref, 'HEAD');
+sub create_and_switch ($$) {
+    my ($branchref, $what) = @_;
+    enable_reflog($branchref);
+    run_git(qw(update-ref -m), "tb-create $newpatch $what", $branchref, 'HEAD');
     run_git(qw(symbolic-ref HEAD), $branchref);
 }
 
     run_git(qw(symbolic-ref HEAD), $branchref);
 }
 
@@ -103,26 +108,23 @@ if (lstat '.topbloke') {
 }
 
 my $baseref = "refs/topbloke-bases/$newpatch";
 }
 
 my $baseref = "refs/topbloke-bases/$newpatch";
-create_and_switch($baseref);
-
-run_git(qw(update-ref -m), "tb-create base $newpatch", $baseref, 'HEAD');
-run_git(qw(symbolic-ref HEAD), $baseref);
+create_and_switch($baseref, 'base');
 
 meta_and_stage('msg', "# not applicable\n");
 
 meta_and_stage('msg', "# not applicable\n");
-meta_and_stage('deps', "# not applicable\n");
-meta_and_stage('flags', '');
+meta_and_stage('deps', "");
+meta_and_stage('props', "patch $current->{Fullname}\n");
 
 if ($current->{Kind} eq 'foreign') {
     meta_and_stage('included', $current->{DepSpec}."\n");
 
 if ($current->{Kind} eq 'foreign') {
     meta_and_stage('included', $current->{DepSpec}."\n");
-    meta_and_stage('pflags', '');
+    meta_and_stage('pprops', '');
 }
 
 }
 
-run_git(qw(commit -q -m), "tb-create base $newpatch");
+run_git(qw(commit -q -m), "tb-create $newpatch base");
 
 #----- create the tip branch
 
 my $tipref = "refs/topbloke-tips/$newpatch";
 
 #----- create the tip branch
 
 my $tipref = "refs/topbloke-tips/$newpatch";
-create_and_switch($tipref);
+create_and_switch($tipref, 'tip');
 
 my $nm = wf_start('.topbloke/msg');
 wf($nm, "From: $author\n");
 
 my $nm = wf_start('.topbloke/msg');
 wf($nm, "From: $author\n");
@@ -143,9 +145,9 @@ wf_done($nm);
 stage_meta('msg');
 
 meta_and_stage('deps', "$current->{DepSpec}\n");
 stage_meta('msg');
 
 meta_and_stage('deps', "$current->{DepSpec}\n");
-# we inherit empty flags from the base branch
+# we inherit correct props and pprops from the base branch
 
 
-flagsfile_add_flag('included',$newpatch);
+depsfile_add_dep('included','tb',$newpatch);
 stage_meta('included');
 
 stage_meta('included');
 
-run_git(qw(commit -q -m), "tb-create tip $spec->{Nick}\n$newpatch\n");
+run_git(qw(commit -q -m), "tb-create $newpatch tip");