# HG changeset patch # User Benoit Boissinot # Date 2009-11-01 01:57:11 # Node ID dd5a16ad420e6d5845d45dc7bde717a90900ccc2 # Parent c6da1cb3b2558d21c7f875dba6bc8ece011f30c0 record: get the right position (account for skipped files) diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -315,6 +315,7 @@ def filterpatch(ui, chunks): return ret pos, total = 0, len(chunks) - 1 while chunks: + pos = total - len(chunks) + 1 chunk = chunks.pop() if isinstance(chunk, header): # new-file mark @@ -350,7 +351,6 @@ def filterpatch(ui, chunks): applied[chunk.filename()].append(chunk) else: fixoffset += chunk.removed - chunk.added - pos = pos + 1 return reduce(operator.add, [h for h in applied.itervalues() if h[0].special() or len(h) > 1], [])