Skip to content

Instantly share code, notes, and snippets.

@ngyuki
Created August 17, 2012 02:36
Show Gist options
  • Save ngyuki/3375422 to your computer and use it in GitHub Desktop.
Save ngyuki/3375422 to your computer and use it in GitHub Desktop.
Subversion でユーザー名を一括置換する
#!/bin/bash
URL=http://example.com/repos/piyo/
DRY=0
OLD=hoge
NEW=fuga
for REV in $(svn log -q "$URL" | grep -w $OLD | awk '{print $1}'); do
VAL=$(svn propget svn:author --revprop -$REV "$URL")
if [ "$VAL" == "$OLD" ]; then
echo "$REV $VAL -> $NEW"
if [ $DRY -eq 0 ]; then
svn propset svn:author --revprop -$REV $NEW "$URL"1>/dev/null
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment