12 Kasım 2008, ÇARŞAMBA
Nasıl SVN bir dosya için tüm tarihsel değişiklikleri görebilir miyim
1* *belirtilen iki revizyonlar arasındaki değişiklikleri görmek için biliyorum. İstediğim dosyayı değiştiren her revizyon için bir diff. Böyle bir komut mevcut mu?
CEVAP
12 Kasım 2008, ÇARŞAMBA
-İnşa için komut yok, ben genelde böyle bir şey yap:
#!/bin/bash
# history_of_file
#
# Outputs the full history of a given file as a sequence of
# logentry/diff pairs. The first revision of the file is emitted as
# full text since there's not previous version to compare it to.
function history_of_file() {
url=$1 # current url of file
svn log -q $url | grep -E -e "^r[[:digit:]] " -o | cut -c2- | sort -n | {
# first revision as full text
echo
read r
svn log -r$r $url@HEAD
svn cat -r$r $url@HEAD
echo
# remaining revisions as differences to previous revision
while read r
do
echo
svn log -r$r $url@HEAD
svn diff -c$r $url@HEAD
echo
done
}
}
history_of_file $1
Bunu Paylaş:
Nasıl gıt için taahhütte bulunmadan ön...
Nasıl bir proje içinde tek bir dosya i...
Nasıl ve bash ile bir dosya için hem s...
Nasıl tek bir dosya için değişiklikler...
Nasıl grep sadece dosya adları (in-lin...