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

MacPorts noreply at macports.org
Sat Aug 10 16:47:21 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 ecronin@…):

 That's basically the same as my current local patch, except I switched to
 pushd/popd to match the changes made to svn, and fixed a message.

 {{{
 diff --git a/base/src/macports1.0/macports.tcl
 b/base/src/macports1.0/macports.tcl
 index 3367705..646d337 100644
 --- a/base/src/macports1.0/macports.tcl
 +++ b/base/src/macports1.0/macports.tcl
 @@ -2233,8 +2233,14 @@ proc mportsync {{optionslist {}}} {
                          incr numfailed
                          continue
                      }
 -                } elseif {$git_cmd ne {} && [file exists
 ${portdir}/.git]} {
 -                    set git_commandline "pushd $portdir ; $git_cmd pull
 --rebase ; popd"
 +                } elseif {$git_cmd ne {} && ![catch {exec sh -c "cd
 ${portdir} && $git_cmd rev-parse --is-inside-work-tree"} result]} {
 +                    # determine what type of git repository this is
 +                    if {![catch {exec sh -c "cd ${portdir} && $git_cmd
 config --local --get svn-remote.svn.url"} result]} {
 +                        set git_action "svn rebase"
 +                    } else {
 +                        set git_action "pull --rebase"
 +                    }
 +                    set git_commandline "pushd $portdir ; $git_cmd
 $git_action ; popd || true"
                      ui_debug $git_commandline
                      if {
                          [catch {
 @@ -2253,7 +2259,7 @@ proc mportsync {{optionslist {}}} {
                          }]
                      } {
                          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:10>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list