[MacPorts] #27485: make "port sync" git - aware

MacPorts noreply at macports.org
Sat Aug 10 22:47:55 PDT 2013


#27485: make "port sync" git - aware
--------------------------+---------------------------------------------
  Reporter:  andy@…       |      Owner:  macports-tickets@…
      Type:  enhancement  |     Status:  new
  Priority:  Normal       |  Milestone:
 Component:  base         |    Version:  1.9.2
Resolution:               |   Keywords:  git, subversion, sync, haspatch
      Port:               |
--------------------------+---------------------------------------------

Comment (by jeremyhu@…):

 Ok, would you mind giving this a sanity check for me?  If it looks good to
 you, I'll push.  Thanks.

 {{{
 ~/src/macports/base/src/macports1.0 $ svn diff
 Index: macports.tcl
 ===================================================================
 --- macports.tcl        (revision 109219)
 +++ macports.tcl        (working copy)
 @@ -2234,7 +2234,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 {
 @@ -2253,7 +2259,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
                      }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/27485#comment:12>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list