[MonoDevelop] "Open for Edit" command [VersionControl]
cmarshall at pacificbiosciences.com
Mon Jul 21 14:31:41 EDT 2008
On Mon, 2008-07-21 at 13:01 +0200, Lluis Sanchez Gual wrote:
> El dv 18 de 07 de 2008 a les 17:45 -0700, en/na Casey Marshall va
> > No comments on this?
> Yes, some.
> > On Tue, 2008-07-08 at 17:50 -0700, Casey Marshall wrote:
> > > Attached is a patch I'm using locally to better support my Perforce
> > > VersionControl add-in, which I've had some good success with. This
> > > change adds an "Open for Edit" command to the contextual menu, and adds
> > > some new methods/properties to Repository to let version control systems
> > > tell whether or not they need to support an edit command, and adds the
> > > edit command itself. I don't know if the command appears for the SVN
> > > addin, and don't know how these commands appear or not in the menu.
> Why not properly implement RequestFileWritePermission instead? MD would
> call RequestFileWritePermission when the user wants to modify a file.
> It wouldn't need to explicitly use an Edit command.
Yeah, that's the ideal way to handle it. The Perforce support in Visual
Studio checks files out automatically, I think, so it's nice to follow
Adding the command just seemed like less work, passing the work onto the
user to manually check files out. But even so, I think I'd like to see
an explicit command for checking files out.
Is RequestFileWritePermission support implemented, or close to it?
> > >
> > > This change also adds a `RepositoryPath' property to ChangeSet, which is
> > > hugely useful for generating perforce changelists.
> Looks ok.
> > >
> > > I'll note a couple of things that were less than helpful in the
> > > implementation:
> > >
> > > * GetPathToBaseText. Perforce doesn't keep local copies of the base
> > > version (at least, I don't think it does), so I need to write a
> > > temporary file to implement this. That's not too bad, but I don't know
> > > how to get notified when that file isn't being used any more, and can be
> > > deleted.
> We should change that api, so it returns a stream or the full content of
> the file.
I'd suggest a stream, or maybe a (filename,callback) pair that signals
the VC backend that the perhaps-temporary file is no longer in use.
More information about the Monodevelop-list