On Sun, Feb 8, 2009 at 3:09 PM, Peter Ruibal <[email protected]> wrote: > On Sun, Feb 8, 2009 at 7:34 AM, Steve Borho <[email protected]> wrote: >> On Sun, 2009-02-08 at 04:19 -0800, Peter Ruibal wrote: >> > # HG changeset patch >> > # User Peter Ruibal <[email protected]> >> > # Date 1234092887 28800 >> > # Node ID 21192efb94b47c673ac73e452fb6f3e474088be4 >> > # Parent b11c51990c3a2771a1d5571534e61a078ceff6c0 >> > hgshelve: files() should return os-native path instead of ones from >> > diff. >> > >> > This fixes a bug causing the chunk state to not be updated when manually >> > changing FM_CHECKED on status/commit dialog on win32. >> > >> > diff -r b11c51990c3a -r 21192efb94b4 hggtk/hgshelve.py >> > --- a/hggtk/hgshelve.py Sat Feb 07 15:29:01 2009 -0600 >> > +++ b/hggtk/hgshelve.py Sun Feb 08 03:34:47 2009 -0800 >> > @@ -123,6 +123,7 @@ >> > >> > def files(self): >> > fromfile, tofile = self.diff_re.match(self.header[0]).groups() >> > + fromfile, tofile = [os.path.normpath(path) for path in >> > (fromfile, tofile)] >> > if fromfile == tofile: >> > return [fromfile] >> > return [fromfile, tofile] >> > >> >> Can you give me a repro case that this fixes? I just want to make sure >> this is the correct solution, since it will probably need to be applied >> to the record extension upstream. >> >> -- >> Steve >> > > Yeah, I'm still not too sure it was the best solution either, but it fixed > my issues; for example, if I look at this patch i've been working on with > the current hgtk, I would see issues on win32: > > 1) hg import --no-commit > http://bitbucket.org/fmoo/thg-win32-setup-etc/raw/3266e0b71218/setup-hgtk-driver.patch > 2) hgtk commit > 3) uncheck the change to 'hggtk\shlib.py'-- notice the changes on the right > do not get updated > 4) activate (disable) a chunk belonging to 'hggtk/shlib.py' on the chunk > viewer -- notice that the checkbox for A; contrib\win32\hgtk.bat gets marked > inconsistent instead of M; hggtk\shlib.py. > 5) check the box for A; contrib\win32\hgtk.bat (presently marked > inconsistent) -- notice that the state of the checkbox doesn't changed > (instead of toggling to active or inactive) > 6) (notice) checking and unchecking 'setup.py' or 'setup.py' chunks works > perfectly. (I believe this is because it is in the root folder of thg -- no > separators in the pathname) > > > So, I added a trace statement to _update_chunk_state, and it was returning > early for: > if file not in self._filechunks: return > > file /was/ in _filechunks; it just had the wrong separators... I traced it > back to files() to make the above change to hgshelve -- > > Though -- it may be more desirable to do something with less of an impact, > such as either: > A) doing a simple file.replace('/', os.path.sep) instead of everything that > os.path.normpath does, OR > B) put the change in status.py to avoid risk of from making changes to the > hgshelve core.
Yes, option B was correct. The problem was that hg status and hg diff return different path separators on WIndows. There's a function in mercurial.util called pconvert() for doing those conversions. I've pushed a fix for this to my repository. Thanks for tracking this down. -- Steve ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Tortoisehg-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop
