How to estimate a branchpoint for manually copied sources?

Henryk Gerlach hgerlach at gmx.de
Mon Jun 30 07:53:03 CDT 2008


> to find out which revision their changes are based upon.  I think this
> looks 
> similar to the above:
> 
> for every revision:
>       hg up -C <rev>
>       diff -ubdr . foreign/src | wc
> 
> and use the revision with the smallest diff.
> 
Well it's not that hard. You can try this:
=====================
#!/bin/bash
FOREIGNSRC=$1
DIFFCMD="diff -ubdr -x \"*.hg*\" . $FOREIGNSRC"

NODES=$( hg log --template "{node} ")
for node in $NODES; do
      hg up -C $node > /dev/null
      diffcount=$($DIFFCMD | wc -l)
      echo $diffcount $node
      # $DIFFCMD
done  | sort -n | head
=====================
which shows you the ten most propable candidates.

Have a nice day,
 Henryk 
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx


More information about the Mercurial mailing list