[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fossil-users
Subject:    [fossil-users] stupid fossil CLI tricks #3239
From:       Stephan Beal <sgbeal () googlemail ! com>
Date:       2012-07-13 17:59:26
Message-ID: CAKd4nAiRrd_cSRYLO0JLzk_Db5hA7KW5DeEt9kkR52EMmqAASw () mail ! gmail ! com
[Download RAW message or body]

Hi, all!

For the Unix users out there, here's one way to climb a lineage of parents
for a given file artifact:

[stephan@host:~/cvs/fossil/fossil/src]$ fArtifactParent() { fossil json
artifact $1 | grep -w parent | cut -d: -f2 | tr -d '[",]' ; }
[stephan@host:~/cvs/fossil/fossil/src]$ x=69851d26ed4; while [[ -n "$x" ]];
do x=$(fArtifactParent $x); echo parent=$x; done
parent=f1a2de8646f0885d29534168d30d72096cdaba7e
parent=e172dfa50fe58e59e1ee71792d732baefcb3d8f4
parent=21c91e21e64840990ea68df141f3d2efd76e9585
parent=ef566cc15ca9441af5bc41c69636ec4687bbb546
parent=659b9f92a84d4bb5b7bb065f4f7e26e5439a3cc5
parent=

(69851d26ed42c1ba987f526dd85dac2f3891a673 == www/stats.wiki, chosen solely
because it was on my screen at the time.)

Happy hacking!

PS: this depends on as-yet-uncommitted changes - the commit will be in
later tonight, though.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

[Attachment #3 (text/html)]

Hi, all!<div><br></div><div>For the Unix users out there, here&#39;s one way to climb \
a lineage of parents for a given file \
artifact:</div><div><br></div><div><div>[stephan@host:~/cvs/fossil/fossil/src]$ \
fArtifactParent() { fossil json artifact $1 | grep -w parent | cut -d: -f2 | tr -d \
&#39;[&quot;,]&#39; ; }</div> <div><div>[stephan@host:~/cvs/fossil/fossil/src]$ \
x=69851d26ed4; while [[ -n &quot;$x&quot; ]]; do x=$(fArtifactParent $x); echo \
parent=$x; done</div><div>parent=f1a2de8646f0885d29534168d30d72096cdaba7e</div><div>parent=e172dfa50fe58e59e1ee71792d732baefcb3d8f4</div>
 <div>parent=21c91e21e64840990ea68df141f3d2efd76e9585</div><div>parent=ef566cc15ca9441 \
af5bc41c69636ec4687bbb546</div><div>parent=659b9f92a84d4bb5b7bb065f4f7e26e5439a3cc5</d \
iv><div>parent=</div><div><br></div></div><div>(69851d26ed42c1ba987f526dd85dac2f3891a673 \
== www/stats.wiki, chosen solely because it was on my screen at the time.)</div> \
<div><br></div><div>Happy hacking!</div><div><br></div><div>PS: this depends on \
as-yet-uncommitted changes - the commit will be in later tonight, \
though.</div><div><br></div>-- <br>----- stephan beal<br><a \
href="http://wanderinghorse.net/home/stephan/" \
target="_blank">http://wanderinghorse.net/home/stephan/</a><div> <a \
href="http://gplus.to/sgbeal" target="_blank">http://gplus.to/sgbeal</a></div><br> \
</div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic