]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Make gitorigin_branch and gitmaster_branch configurable via the setup
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 27 Jan 2007 23:56:17 +0000 (23:56 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 27 Jan 2007 23:56:17 +0000 (23:56 +0000)
  file. Closes: #408599

IkiWiki.pm
IkiWiki/Rcs/git.pm
debian/changelog
doc/ikiwiki.setup

index 42d607b0dcbc66b5aa8b24e1bade33a2212e569b..10d178f3efddc531ab766b413d371ee4aa8789e8 100644 (file)
@@ -56,6 +56,8 @@ sub defaultconfig () { #{{{
        wrappermode => undef,
        svnrepo => undef,
        svnpath => "trunk",
+       gitorigin_branch => "origin",
+       gitmaster_branch => "master",
        srcdir => undef,
        destdir => undef,
        pingurl => [],
index ad829221c7db30304ea5511b5c558ea26128c7a8..7f33148e396751852488b92264245219b208f59b 100644 (file)
@@ -8,8 +8,6 @@ use open qw{:utf8 :std};
 
 package IkiWiki;
 
-my $origin_branch    = 'origin';            # Git ref for main repository
-my $master_branch    = 'master';            # working branch
 my $sha1_pattern     = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
 my $dummy_commit_msg = 'dummy commit';      # message to skip in recent changes
 
@@ -112,8 +110,8 @@ sub _merge_past ($$$) { #{{{
 
                # Switch to throw-away branch for the merge operation.
                push @undo, sub {
-                       if (!run_or_cry('git-checkout', $master_branch)) {
-                               run_or_cry('git-checkout','-f',$master_branch);
+                       if (!run_or_cry('git-checkout', $config{gitmaster_branch})) {
+                               run_or_cry('git-checkout','-f',$config{gitmaster_branch});
                        }
                };
                run_or_die('git-checkout', $branch);
@@ -125,7 +123,7 @@ sub _merge_past ($$$) { #{{{
                # _Silently_ commit all modifications in the current branch.
                run_or_non('git-commit', '-m', $message, '-a');
                # ... and re-switch to master.
-               run_or_die('git-checkout', $master_branch);
+               run_or_die('git-checkout', $config{gitmaster_branch});
 
                # Attempt to merge without complaining.
                if (!run_or_non('git-pull', '--no-commit', '.', $branch)) {
@@ -287,7 +285,7 @@ sub git_sha1 (;$) { #{{{
 sub rcs_update () { #{{{
        # Update working directory.
 
-       run_or_cry('git-pull', $origin_branch);
+       run_or_cry('git-pull', $config{gitorigin_branch});
 } #}}}
 
 sub rcs_prepedit ($) { #{{{
@@ -337,7 +335,7 @@ sub rcs_commit ($$$;$$) { #{{{
        $message = possibly_foolish_untaint($message);
        if (run_or_non('git-commit', '-m', $message, '-i', $file)) {
                unlockwiki();
-               run_or_cry('git-push', $origin_branch);
+               run_or_cry('git-push', $config{gitorigin_branch});
        }
 
        return undef; # success
index 6234668a70f042aa8e13eafbea728278369f02e1..5903192f37c05bbbdeffd71c1291cf38c53c8621 100644 (file)
@@ -5,8 +5,10 @@ ikiwiki (1.41) UNRELEASED; urgency=low
     crashing.
   * Added smileys for Moin Moin compatability.
   * Fix handling of discussion links on discussion pages when l10n is used.
+  * Make gitorigin_branch and gitmaster_branch configurable via the setup
+    file. Closes: #408599
 
- -- Joey Hess <joeyh@debian.org>  Thu, 18 Jan 2007 10:03:59 -0500
+ -- Joey Hess <joeyh@debian.org>  Sat, 27 Jan 2007 18:55:45 -0500
 
 ikiwiki (1.40) unstable; urgency=low
 
index af60e076b698be832afff9dfd51193fe7c6addc9..910b2b527dcfa97538b2660d14613b5de8693710 100644 (file)
@@ -29,6 +29,8 @@ use IkiWiki::Setup::Standard {
        #rcs => "git",
        #historyurl => "http://git.example.org/gitweb.cgi?p=wiki.git;a=history;f=[[file]]",
        #diffurl => "http://git.example.org/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]",
+       #gitorigin_branch => "origin",
+       #gitmaster_branch => "master",
 
        # Tla stuff.
        #rcs => "tla"