[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Re: History of a single file
From: |
Henry Nestler |
Subject: |
[Monotone-devel] Re: History of a single file |
Date: |
Tue, 05 Apr 2005 23:53:02 +0200 |
User-agent: |
Mozilla Thunderbird 0.6 (Windows/20040502) |
Nathaniel Smith wrote:
On Fri, Apr 01, 2005 at 08:29:09PM +0200, Henry Nestler wrote:
can I get a history of a single file.
As list of changes by date,
"monotone log <filename>"
Well. Yes, this I'm looking for! :-)
Why not document this nice function in help and command reference? I
found only "monotone log" or "monotone log /id/", with /id/ should be a
revision. I never try to use a file instand a /id/.
and then as list of diff between changes.
This isn't currently doable, except by a bit of scripting. The log
output has the pre- and post- revision ids for each revision the file
changed in, though, and they can be passed directly to "monotone diff
--revision=<rev1> --revision=<rev2> <filename>".
With previous command it's easy to make a script. Here are two of them.
>>> cut here >>>
filename="MyPath/MyFile"
rev2=""
monotone log $filename | \
sed -n -r -e 's/^Revision: ([0-9a-f]{40})$/\1/p' | \
while read rev1; do
if [ -n "$rev2" ]; then
echo "diff $filename"
echo "# Revision: $rev2"
echo "# Ancestor: $rev1"
monotone diff --revision="$rev1" --revision="$rev2" $filename
fi
rev2=$rev1
done
<<< end cut <<<
>>> cut sample with log entries >>>
filename="MyPath/MyFile"
rev2=""
monotone log $filename | \
while read line; do
rev1=`echo "$line" | sed -n -r -e 's/Revision: ([0-9a-f]{40})/\1/p'`
if [ -n "$rev1" ]; then
if [ -n "$rev2" ]; then
echo "diff $filename"
monotone diff --revision="$rev1" --revision="$rev2" $filename
echo "# ====================================================="
fi
rev2=$rev1
fi
echo "# $line"
done
<<< end cut <<<
I use sometime monotone-viz, but this program runs not on machine with
text console, ssh connection. :-(
ssh X forwarding? ;-)
No X installed on all places. Some Windows. :-(
But I need no monotone-viz now, have "monotone log <file>" now!
Many thanks for support!
Henry Nestler