[Pmwiki-users] Edit / Lock Pages

Patrick R. Michaud pmichaud
Tue Jan 27 20:03:35 CST 2004


On Wed, Jan 28, 2004 at 02:08:58AM +0100, Christian Ridderstr?m wrote:
> On Tue, 27 Jan 2004, Patrick R. Michaud wrote:
> 
> > Yes, this part is easy--it's conflict detection.  The real question is, 
> > what should happen once a conflict has been detected?

After thinking about it this afternoon, I'm thinking that whenever
a conflict is detected (either because the user pressed "Save" or "Preview"),
the user is returned to the edit form with a message warning that someone
else has changed the page during the edit session, along with options to 
  (1) Open another window displaying the changes made to the saved page
      since the beginning of the edit session,
  (2) Abandon the edits made thus far and start editing again with the
      latest saved version of the page,
  (3) Go ahead and overwrite the page with the current contents.

I figure this will allow someone to quickly look to see what other changes
were made (via #1), and decide if they want to merge the saved changes 
into their current edit session and save them (#3) or revert to the 
newly saved page (#2) and add their edits to that one.  

> > PmWiki already does file locking to make sure this doesn't happen--
> > this is the purpose of the .flock file.
> 
> Oh, I've never noticed that before. Is it global, i.e. one lock file
> for an entire directory?

Actually it's one lock file for all running instances of PmWiki.  There's
a shared lock if people are just viewing/reading pages, and an exclusive 
lock for anything that is in the process of changing a file (i.e.,
?action=post).  

Pm



More information about the pmwiki-users mailing list