[109747] trunk/base/src/macports1.0/macports.tcl

jeremyhu at macports.org jeremyhu at macports.org
Mon Aug 19 12:40:12 PDT 2013


Revision: 109747
          https://trac.macports.org/changeset/109747
Author:   jeremyhu at macports.org
Date:     2013-08-19 12:40:12 -0700 (Mon, 19 Aug 2013)
Log Message:
-----------
Update port sync to support git-svn

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2013-08-19 19:36:51 UTC (rev 109746)
+++ trunk/base/src/macports1.0/macports.tcl	2013-08-19 19:40:12 UTC (rev 109747)
@@ -2210,7 +2210,13 @@
                         continue
                     }
                 } elseif {$git_cmd ne {} && [file exists ${portdir}/.git]} {
-                    set git_commandline "pushd $portdir ; $git_cmd pull --rebase ; popd"
+                    # determine what type of git repository this is
+                    if {![catch {exec sh -c "$git_cmd --git-dir=${portdir}/.git config --local --get svn-remote.svn.url"} result]} {
+                        set git_action "svn rebase"
+                    } else {
+                        set git_action "pull --rebase"
+                    }
+                    set git_commandline "$git_cmd --git-dir=${portdir}/.git --work-tree=${portdir} $git_action"
                     ui_debug $git_commandline
                     if {
                         [catch {
@@ -2229,7 +2235,7 @@
                         }]
                     } {
                         ui_debug $::errorInfo
-                        ui_error "Synchronization of the local ports tree failed doing a git pull --rebase"
+                        ui_error "Synchronization of the local ports tree failed doing a git update"
                         incr numfailed
                         continue
                     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130819/6f0b3ee6/attachment.html>


More information about the macports-changes mailing list