alarmz / boar

Automatically exported from code.google.com/p/boar
0 stars 0 forks source link

AssertionError: Offset was: workdir Path was: workdir_longer/file #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import 2 directories with one directory's name is part of the other
2. Modify something in the longer-named directory
3. Go to the short-named directory and update

Run issue.sh to simulate this situation

What is the expected output? What do you see instead?
Boar should update normally, instead it spit out: 

AssertionError: Offset was: workdir Path was: workdir_longer/file

What platform are you using? (Windows XP, Windows 7, Linux, ...)
Ubuntu 10

What version of Python are you using?
Python 2.6

What version of boar are you using? (Mercurial change id or daily build
date)
70b62d23db  

Please provide any additional information below.
My attempt: issue9.patch

Original issue reported on code.google.com by uts...@gmail.com on 11 Mar 2011 at 1:46

Attachments:

GoogleCodeExporter commented 9 years ago
hmm, I didn't realize it's issue 12 . 

Original comment by uts...@gmail.com on 11 Mar 2011 at 1:47

GoogleCodeExporter commented 9 years ago

Original comment by uts...@gmail.com on 11 Mar 2011 at 1:53

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch. This is a bug in how offset checkouts are handled. The update 
procedure excludes all files outside the current workdir by only including the 
ones starting with the offset of the current workdir. That is, if the offset is 
"workdir", it should include "workdir/file1.txt" but exclude 
"workdir_longer/file2.txt". The broken test only checks if the filename starts 
with the offset, even if that is only the beginning of a dir name. This causes 
some unexpected files be passed on to another subroutine which notices that 
something is wrong, and throws the given exception. The corrected version 
should check if the files starts with the offset plus a dir separator.

Original comment by ekb...@gmail.com on 12 Mar 2011 at 6:03

GoogleCodeExporter commented 9 years ago
Fixed in changeset 305:47928f30f85f. I solved it in a different way than the 
given patch (it caused some other tests to fail). Thanks for noticing this 
problem, it might have been a while before this subtle but serious bug would 
had been found otherwise. Please verify that it works.

Original comment by ekb...@gmail.com on 13 Mar 2011 at 4:57

GoogleCodeExporter commented 9 years ago
it works, cool.

Original comment by uts...@gmail.com on 16 Mar 2011 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by ekb...@gmail.com on 16 Mar 2011 at 2:24