[cfe-dev] How to update from svn?

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Sun May 29 09:19:41 PDT 2016


I think everyone has their own little scripts for this - I have one for
git-svn that goes a little something like this (though it freaks out if
there's an untracked directory - like a newly created but not yet git add'd
one).

We should possibly get one such script checked into the repo as an
authoritative tool:

#!/bin/sh

if ! git remote -v 2> /dev/null | grep "http://llvm.org/git" > /dev/null; then
  echo "Not an llvm git repo"
  exit 1
fi

while ! git remote -v 2> /dev/null | grep
"http://llvm.org/git/llvm.git" > /dev/null; do
  if ! git remote -v 2> /dev/null > /dev/null; then
    echo "Could not find the root of the llvm git repository"
    exit 1
  fi
  cd `git rev-parse --show-toplevel`/../
done

cd `git rev-parse --show-toplevel` > /dev/null

function fetchAndRebase {
  if [ -d $1 ]; then
    pushd $1 > /dev/null
    if git status > /dev/null; then
      (git stash | grep "No local changes to save" > /dev/null
      STASHED=$?
      git fetch > /dev/null
      git svn rebase -l
      if [ $STASHED -ne 0 ]; then git stash pop > /dev/null; fi) &
      for dir in `git status --ignored | grep /$ | sed -e "s/^#//"`; do
        fetchAndRebase $dir
      done
    fi
    popd > /dev/null
  fi
}

fetchAndRebase `git rev-parse --show-toplevel`
wait


On Sat, May 28, 2016 at 11:35 PM, Csaba Raduly via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Now that autoconf support is gone and with it the "update" target
> (still mentioned in the "Getting started" document:
> http://clang.llvm.org/get_started.html), what is the recommended way
> to update llvm, clang and any other project (clang-tools-extra,
> compiler-rt, etc.) from Subversion? Do I have to change manually into
> the appropriate directories and issue "svn up" ?
>
>
> Csaba
> --
> GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
> The Tao of math: The numbers you can count are not the real numbers.
> Life is complex, with real and imaginary parts.
> "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus
> Torvalds
> "People disagree with me. I just ignore them." -- Linus Torvalds
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160529/1e0b0f7a/attachment.html>


More information about the cfe-dev mailing list