I've been having similar problems with the Perforce integration. I dug into it a bit this morning, and here is what I see happening:
When I open a file that is under Perforce control, SE does set the CWD. However, inside the getPerforceInfo function, which in turn calls the perforceRunCommand, it appears that a new process/shell is created, which is set to the default directory I get when creating a new shell. In my case, it is the Documents directory inside my home directory. So my guess is that no matter what the current directory is for SE, the means by which the command is executed doesn't get that same environment, causing the command to be executed outside the context of the desired directory structure.
I initially tried my p4 commands by right clicking the file in the project explorer, so I thought perhaps my problem was that the CWD was set to some other file in the current buffer. However, even if I add a call to chdir based on the localFilename parameter passed to getHistoryInformation, the Perforce CWD is set to the default shell directory. After the context of the perforceRunCommand, the CWD is still set to what I manually set it to.
I am running B2 on Ubuntu 12.04 x86_64. I hope this is helpful.