On 12 June 2014 18:13, Ferro, Alasdair <[email protected]> wrote:

>  Hi,
>
>
>
> I’ve recently upgraded from meld 1.4 to 1.8.5, having finally been able to
> upgrade my office workstation to SLES11-SP1 :-)
>
>
>
> We use Perforce for version control, and had modified the “Open
> Externally” menu pick to use a custom command - “p4 edit” – i.e. checkout
> the file and make it available for editing. Meld did not check file
> permission until trying to save changes, so this worked well. With the move
> to 1.8.5, this is no longer the case – when the file is initially opened,
> it is read only, so meld does not allow changes to copied into it. After
> the “Open Externally” has been called, the file is now writable, but meld
> does not notice the change in permissions.
>
>
>
> I have hacked about in the 1.8.5 source, to add a new menu item “Perforce
> Edit”, which I can get to call “p4 edit”, but I cannot work out how to get
> the file status to be checked again. I found the on_current_diff_changed
> method, which appears to update the state of the push & pull arrows, but I
> cannot work out how to call this from the result of the menu pick L If
> anybody can point me (as a total python newbie!) in the right direction,
> that would be great.
>

The call you actually want is set_buffer_writable(). This is called in a
couple of places after an os.access() call, so have a look at those.

As a better solution, do you get the 'file changed do you want to reload?'
prompt after your custom command? If so, a better overall solution (and one
that I would probably accept upstream) would be to add an os.access() check
to notify_file_changed(). I haven't tried that, but I imagine it would work.

cheers,
Kai
_______________________________________________
meld-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/meld-list

Reply via email to