darcs

Issue 194 pull => bug in function reconcile_unwindings (** minimal test case **)

Title pull => bug in function reconcile_unwindings (** minimal test case **)
Priority urgent Status resolved
Milestone Resolved in
Superseder Nosy List agthorr, ben, darcs-devel, dmitry.kurochkin, kowey, norman-ramsey, thorkilnaur, tommy, zooko
Assigned To droundy
Topics Conflicts

Created on 2006-07-03.20:22:41 by agthorr, last changed 2009-10-24.00:06:39 by admin.

Messages
msg726 (view) Author: agthorr Date: 2006-07-03.20:22:38
While doing a push, darcs died and told me to submit the following
information.  If there's a simple workaround that will let me complete
the push, that would be very much appreciated.  Let me know if there's
any further information I can provide.

The machine I'm pushing from is an AMD Opteron running Linux.  The
machine I'm pushing to runs Solaris.

The Opteron's --exact-version is:

------------------------------------------------------------------------
darcs compiled on May 15 2006, at 00:35:04
# configured Mon May 15 00:29:05 CEST 2006
./configure --with-static-libs

Context:

[TAG 1.0.7
Tommy Pettersson <ptp@lysator.liu.se>**20060513171438] 
------------------------------------------------------------------------

The Solaris machine's is:

------------------------------------------------------------------------
darcs compiled on Mar  4 2006, at 21:34:19
# configured Tue Feb 28 07:02:39 EST 2006
./configure --no-create --no-recursion

Context:

[TAG 1.0.6
Tommy Pettersson <ptp@lysator.liu.se>**20060228111841] 
------------------------------------------------------------------------

and the output of the command is:

------------------------------------------------------------------------
Pushing to "ix.cs.uoregon.edu:src/crawler/"...

Fri Oct 28 21:14:54 PDT 2005  agthorr@barsoom.org
  * Changes to h2cdf and d2cdf for greater accuracy
Shall I push this patch? (1/?)  [ynWvpxqadjkc], or ? for help: 

Sat Oct 29 01:47:17 PDT 2005  agthorr@barsoom.org
  * Bugfix for tools.py.  Removed a
Shall I push this patch? (2/?)  [ynWvpxqadjkc], or ? for help: 

Sat Oct 29 10:56:34 PDT 2005  agthorr@barsoom.org
  * Bugfix for h2cdft in tools.py
Shall I push this patch? (3/?)  [ynWvpxqadjkc], or ? for help: 

Sat Oct 29 13:35:10 PDT 2005  agthorr@barsoom.org
  * Fixed h2cdft so d2cdft works correctly
Shall I push this patch? (4/?)  [ynWvpxqadjkc], or ? for help: 

Sun Oct 30 10:56:12 PST 2005  agthorr@barsoom.org
  * Added pickler support; added strptime()
Shall I push this patch? (5/?)  [ynWvpxqadjkc], or ? for help: 

Sat Dec  3 13:45:14 PST 2005  agthorr@barsoom.org
  * Added get_start_time to tools
Shall I push this patch? (6/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 11:46:41 PST 2005  agthorr@barsoom.org
  * Updated Infinity to work on Windows
Shall I push this patch? (7/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 11:47:34 PST 2005  agthorr@barsoom.org
  * parse_tools.py, part 1
Shall I push this patch? (8/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 11:53:43 PST 2005  agthorr@barsoom.org
  * Moved stuff out of parse_tools.py, now in tools.py
Shall I push this patch? (9/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 12:29:14 PST 2005  agthorr@barsoom.org
  * Added tools.py for crawler backwards compatibility
Shall I push this patch? (10/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 16:56:43 PST 2005  agthorr@barsoom.org
  * Made tools.py less path-sensitive
Shall I push this patch? (11/?)  [ynWvpxqadjkc], or ? for help: 

Fri Dec  2 16:56:53 PST 2005  agthorr@barsoom.org
  * Made import of parse_tools optional
Shall I push this patch? (12/?)  [ynWvpxqadjkc], or ? for help: 

Tue May 16 15:20:16 PDT 2006  agthorr@barsoom.org
  * Added many new cases to parse_tools and made more robust
Shall I push this patch? (13/?)  [ynWvpxqadjkc], or ? for help: 

Sun May 21 11:02:33 PDT 2006  agthorr@barsoom.org
  * Ported gnutella analysis tools to 64-bit
Shall I push this patch? (14/?)  [ynWvpxqadjkc], or ? for help: 
darcs: bug in darcs!
in function reconcile_unwindings
Original patch:
merger 0.0 (
merger 0.0 (
hunk ./parse_tools.py 710
+    scale = 1.0/(total+gap)
merger 0.0 (
merger 0.0 (
hunk ./parse_tools.py 717
+    pairs = sorted(pairs)
merger 0.0 (
hunk ./parse_tools.py 708
-def h2cdf(pairs):
+def d2cdf(d): return d2cdft(d)[0]
+
+def cdf2ccdf(lst):
+    if len(lst) == 2 and type(lst) == type(()):
+        lst, total = lst
+        return [(x, 100.0-y) for x, y in lst] + [[], [], [total]]
+    return [(x, 100.0-y) for x, y in lst]
+
+def h2cdft(pairs):
hunk ./parse_tools.py 708
-def h2cdf(pairs):
+def h2cdf(pairs, gap=0):
)
)
hunk ./parse_tools.py 671
-def eq_e(x,y):
-    epsilon = 0.01 * min(abs(x),abs(y))
-    if abs(x - y) <= epsilon: return True
-    return False
-
-def fcdf(values):
-    values = list(values)
-    values.sort()
-    cdf = [(values[i], (i+1)*100.0/len(values)) for i in xrange(len(values))]
-    count = 0
-    i = 0
-    while i < len(cdf)-2:
-        if eq_e(cdf[i][0], cdf[i-1][0]) and eq_e(cdf[i][0], cdf[i-2][0]) or \
-               eq_e(cdf[i][1], cdf[i-1][1]) and eq_e(cdf[i][1], cdf[i-2][1]):
-            del cdf[i]
-            count += 1
-        else:
-            i += 1
-    return cdf 
-
-try:
-    Infinity = float('Infinity')
-except ValueError:
-    Infinity = float(10**10)
-
-def d2cdft(d):
-    return h2cdft(d.items())
-    total = sum(d.values())
-    n = 0
-    keys = sorted(d.iterkeys())
-    rv = [(keys[0], 0.0)]
-    for v in sorted(d.iterkeys()):
-        if v == Infinity: continue
-        n += d[v]*100.0/total
-        rv.append((v,n))
-    return rv, total
-
-def d2cdf(d): return d2cdft(d)[0]
-
-def cdf2ccdf(lst):
-    if len(lst) == 2 and type(lst) == type(()):
-        lst, total = lst
-        return [(x, 100.0-y) for x, y in lst] + [[], [], [total]]
-    return [(x, 100.0-y) for x, y in lst]
-
-def h2cdft(pairs):
-    pairs = sorted(pairs)
-    total = sum([y for x,y in pairs])
-    n = 0
-    rv = [(pairs[0][0], 0.0)]
-    for x,y in pairs:
-        if x == Infinity: continue
-        n += y*100.0/total
-        if len(rv) and (x,n) == rv[-1]: continue
-        rv.append((x, rv[-1][1]))
-        rv.append((x,n))
-    return rv, total
-
-def h2cdf(pairs): return h2cdft(pairs)[0]
-
-def memoize(f):
-    def g(*args):
-        if args not in g.cache:
-            if len(g.cache) > 100000:
-                for k in random.sample(g.cache.iterkeys(), 10000):
-                    del g.cache[k]
-            g.cache[args] = f(*args)
-        return g.cache[args]
-    g.cache = {}
-    return g
-
-def bisect(g, lowx, highx, target=0):
-    f = lambda x: target-g(x)
-    lowy = f(lowx)
-    highy = f(highx)
-    assert sign(lowy) != sign(highy), (lowx, lowy, highx, highy)
-    while 1:
-        midx = (lowx + highx) / 2.0
-        y = f(midx)
-        if y == 0:
-            break
-        if midx == lowx or midx == highx: break
-        if sign(y) == sign(lowy):
-            # Too low
-            lowx = midx
-        else:
-            # Too high
-            highx = midx
-    return midx
-
-def sign(x):
-    if not x: return 0
-    return x / abs(x)
-
-try:
-    from utils.orthogonal import P_roots
-    from Numeric import sum
-    
-    @memoize
-    def quad(func,a,b,n=5):
-        """val = quad(func,a,b,n=5)
-    
-        Integrate func(x) from a to b using Gaussian Quadrature of order n.
-        """
-        [x,w] = P_roots(n)
-        y = (b-a)*(x+1)/2.0 + a
-        return (b-a)/2.0*sum(w*func(y))
-    
-    @memoize
-    def quadtol(func,a,b,tol=1e-7,NMAX=200):
-        """val = quadtol(func,a,b,tol=1e-7,NMAX=30)
-    
-        Integrate func(x) from a to b using Gaussian Quadrature 
-        with absolute tolerance tol.
-        """
-        err = 100.0
-        val = err
-        n = 5
-        while (err > tol) and (n < NMAX):
-            if (n>=NMAX):
-                raise "NMAX (%d) exceeded. Latest difference = %e" % (n,err)
-            newval = quad(func,a,b,n)
-            err = abs(newval-val)
-            val = newval
-            n = int(n * 1.3)
-        return val
-except ImportError:
-    pass
-
-def cdf2h(data):
-    rv = [data[0]]
-    for i in range(1,len(data)):
-        rv.append((data[i][0], data[i][1]-data[i-1][1]))
-    return rv
-
-def from_items(lst):
-    rv = {}
-    for k, v in lst:
-        rv[k] = v
-    return rv
-
-def as_seconds(dt):
-    return dt.days*24*60*60.0 + dt.seconds + dt.microseconds/1000000.0
-
-def as_minutes(dt):
-    return dt.days*24*60.0 + (dt.seconds + dt.microseconds/1000000.0)/60.0
- 
-def completion_bar(seq, length=None):
-    if length is None: length = len(seq)
-    length = float(length)
-    hashes = 0.0
-    for i, x in izip(count(), seq):
-        while i/length > hashes / 80.0:
-            sys.stderr.write('#')
-            sys.stderr.flush()
-            hashes += 1
-        yield x
-    while hashes < 80.0:
-        sys.stderr.write('#')
-        hashes += 1
-    sys.stderr.write('\n')
-
-def strptime(s):
-    return datetime.datetime(*time.strptime(s, '%Y-%m-%d %H:%M:%S')[:6])
)
)
merger 0.0 (
hunk ./parse_tools.py 717
-        rv.append((x, pairs[-1][1]))
+        rv.append((x, rv[-1][1]))
merger 0.0 (
hunk ./parse_tools.py 717
-a        rv.append((x, pairs[-1][1]))
+        rv.append((x, pairs[-1][1]))
merger 0.0 (
hunk ./parse_tools.py 716
+        if len(rv) and (x,n) == rv[-1]: continue
+a        rv.append((x, pairs[-1][1]))
hunk ./parse_tools.py 715
-        n += y*100.0/total
+        n += y*100.0*scale
)
)
)
)
Please report this to bugs@darcs.net
If possible include the output of 'darcs --exact-version'.
------------------------------------------------------------------------
msg1084 (view) Author: kowey Date: 2006-10-13.11:26:09
Merge from RT #453

athewa <atehwa@sange.fi> 2005-07-06
-----------------------------------
Subject: Darcs reports a bug while merging

Here is a reproducible bug in darcs 1.0.3:

- repository foo is empty.
- foo is forked into bar.
- a file named "test" is created in foo, moved under the name "best",
and back into "test". (Why, by the way, does darcs collapse pending
moves but not addfiles and moves of the same file?)
- a file named "test2" is created in bar, moved under the name "best",
and back into "test2".
- we do a pull from foo into bar:

--- clip ---
[atehwa@maim ~/tmp/try/bar]$ darcs pull
Pulling from "/home/atehwa/tmp/try/foo"...

Thu Jun 30 00:58:58 EEST 2005 atehwa@sange.fi
* test
Shall I pull this patch? (1/2) [ynWvpxqadjk], or ? for help: y

Thu Jun 30 00:59:20 EEST 2005 atehwa@sange.fi
* test
Shall I pull this patch? (2/2) [ynWvpxqadjk], or ? for help: y

Fail: bug in darcs!
in function reconcile_unwindings
Original patch:
merger 0.9 (
merger 0.0 (
(
move ./best ./best-conflict
move ./test ./best
)
move ./best ./test2
)
merger 0.0 (
move ./test2 ./best-conflict
move ./best ./test
)
)
Please report this to bugs@darcs.net
If possible include the output of 'darcs --exact-version'.
[atehwa@maim ~/tmp/try/bar]$ darcs --exact-version
darcs compiled on Jun 5 2005, at 16:16:25
# configured Tue May 24 18:34:35 EDT 2005
sh ./configure

Context:

[TAG 1.0.3
Tomasz Zielonka <tomasz.zielonka@gmail.com>**20050524215127]
--- clip ---
msg1085 (view) Author: kowey Date: 2006-10-13.11:27:13
I just tried athewa's example on my machine.  It is current, reproducable and
minimal.  This looks like the best reconcile_unwindings example we have so far.

It is current (1.0.8), reproducable and minimal.  Worth looking into!

Summary of the steps
--------------------
mkdir foo; cd foo ; darcs init ; cd ..
darcs get foo bar
cd bar/ ; echo 'x' > _darcs/prefs/author ; cd ..
cd foo/ ; echo 'x' > _darcs/prefs/author ; cd ..

cd foo/
touch test ; darcs record
darcs add test     ; darcs record -a -m 'test'
darcs mv test best ; darcs record -a -m 'test -> best'
darcs mv best test ; darcs record -a -m 'best -> test'
cd ..

cd bar/
touch test2
darcs add test2     ; darcs record -a -m 'test2'
darcs mv test2 best ; darcs record -a -m 'test2 -> best'
darcs mv best test2 ; darcs record -a -m 'best -> test2'

darcs pull ../foo/ -a

The error
---------
darcs: bug in darcs!
in function reconcile_unwindings
Original patch:
merger 0.9 (
merger 0.0 (
(
move ./best ./best-conflict
move ./test ./best
)
move ./best ./test2
)
merger 0.0 (
move ./test2 ./best-conflict
move ./best ./test
)
)
Please report this to bugs@darcs.net
If possible include the output of 'darcs --exact-version'.


darcs --exact-version
---------------------
darcs compiled on Jun 20 2006, at 18:10:15
# configured Fri Jun 16 14:55:21 EDT 2006
./configure --no-create --no-recursion

Context:

[TAG 1.0.8
Tommy Pettersson <ptp@lysator.liu.se>**20060616160213]
msg2159 (view) Author: zooko Date: 2007-10-06.17:06:58
What's the status with this?  It just impeded a volunteer who was trying to
contribute to my allmydata.org project, so I'm pretty interested in getting this
fixed.  I guess that since it is flagged as "Topics: Conflicts" that we are
waiting for darcs 2.0 to solve it?

Allmydata.com will send a personalized thank you gift to the person who fixes
this bug.
msg2320 (view) Author: droundy Date: 2008-01-05.15:21:41
I'm marking this as resolved-in-unstable, since the darcs-2 format should fix
this issue.
History
Date User Action Args
2006-07-03 20:22:41agthorrcreate
2006-07-03 20:39:37droundysetnosy: droundy, tommy, agthorr
2006-07-03 20:39:50droundysetnosy: droundy, tommy, agthorr
title: bug in darcs -> bug in function reconcile_unwindings
2006-07-03 20:40:14droundylinkissue194 superseder
2006-07-03 20:40:14droundysetnosy: droundy, tommy, agthorr
superseder: + pull => bug in function reconcile_unwindings (** minimal test case **)
2006-07-03 20:40:38droundylinkissue195 superseder
2006-07-03 20:42:27droundylinkissue200 superseder
2006-07-03 20:47:02droundysetnosy: droundy, tommy, agthorr
2006-07-03 21:01:04droundylinkissue212 superseder
2006-07-03 21:03:36droundylinkissue207 superseder
2006-07-04 12:01:59droundylinkissue136 superseder
2006-07-04 13:01:40droundylinkissue209 superseder
2006-10-01 20:08:20koweylinkissue280 superseder
2006-10-13 11:26:18koweysettopic: + Conflicts
status: unread -> unknown
messages: + msg1084
nosy: + kowey
2006-10-13 11:27:16koweysetnosy: droundy, tommy, kowey, agthorr
messages: + msg1085
2007-07-18 08:02:14koweyunlinkissue194 superseder
2007-07-18 08:02:14koweysetnosy: + beschmi
superseder: - pull => bug in function reconcile_unwindings (** minimal test case **)
title: bug in function reconcile_unwindings -> pull => bug in function reconcile_unwindings (** minimal test case **)
2007-07-18 08:02:32koweylinkissue13 superseder
2007-07-18 08:13:39koweylinkissue335 superseder
2007-07-18 08:19:29koweylinkissue22 superseder
2007-07-18 08:22:04koweylinkissue96 superseder
2007-07-23 13:58:31koweylinkissue248 superseder
2007-08-03 17:58:38koweysetpriority: bug -> urgent
nosy: kowey, agthorr, droundy, tommy, beschmi
2007-08-03 18:02:44koweylinkissue191 superseder
2007-08-14 17:21:50koweylinkissue519 superseder
2007-08-14 17:22:06koweysetnosy: + ben
2007-10-06 17:07:00zookosetnosy: + zooko
messages: + msg2159
2007-10-29 00:36:03koweysetnosy: + nr, norman-ramsey
2007-10-29 00:37:00koweylinkissue530 superseder
2008-01-05 15:21:44droundysetstatus: unknown -> resolved-in-unstable
messages: + msg2320
2008-09-04 21:28:27adminsetstatus: resolved-in-unstable -> resolved
nosy: + dagit
2009-08-06 17:40:40adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, mornfall, simon, thorkilnaur, - droundy, agthorr, ben, nr, norman-ramsey
2009-08-06 20:37:49adminsetnosy: - beschmi
2009-08-10 21:52:19adminsetnosy: + nr, norman-ramsey, agthorr, ben, - markstos, darcs-devel, jast, Serware, mornfall
2009-08-10 23:54:35adminsetnosy: - dagit
2009-08-25 17:54:12adminsetnosy: + darcs-devel, - simon
2009-08-27 14:04:29adminsetnosy: tommy, kowey, darcs-devel, zooko, agthorr, thorkilnaur, ben, nr, norman-ramsey, dmitry.kurochkin
2009-10-23 22:41:18adminsetnosy: - norman-ramsey
2009-10-24 00:06:39adminsetnosy: + norman-ramsey, - nr
2010-04-26 16:43:40koweylinkissue1820 superseder