// // Created by Tristan Juricek on 9/19/15. // #ifndef FSCLIENT_WORKSPACE_H #define FSCLIENT_WORKSPACE_H #include <chrono> #include <string> #include "Notification.h" class WorkspaceImpl; // Manages access to the Perforce workspace we're editing via the mirror. // // This handles an intelligent call to p4 reconcile. class Workspace { public: ~Workspace(); Workspace(); Workspace(const std::string & workspace); // The local directory location that is the root of our Perforce workspace void setWorkspace(std::string & w) { _workspace = w; } // The local directory location that is the root of our Perforce workspace const std::string & workspace() const { return _workspace; } // Convert the relative path to the absoluite local directory location // underneath the Perforce workspace std::string path(const std::string & p) const; // Use this specific changelist number instead of the default changelist // for calls to p4 reconcile. void setChangelist(const std::string & c); // Use this specific changelist number instead of the default changelist // for calls to p4 reconcile. const std::string & changelist() const; // The time we wait from the last file operation to trigger p4 reconcile. int pauseAmount() const; // The time we wait from the last file operation to trigger p4 reconcile. void setPauseAmount(int t); // If true, the workspace is churning bool processing() const; // Debugging status for the last operations std::string status(); void enqueue(const Notification & n); //----------------------------------------------------------------------- // Failure codes //----------------------------------------------------------------------- static const int CONNECTION_FAILURE = -1; static const int COMMAND_FAILURE = -2; private: std::string _workspace; WorkspaceImpl *_impl; }; #endif //FSCLIENT_WORKSPACE_H
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 16236 | tjuricek |
Revise FUSE-client to call p4 reconcile intelligently. This uses the main FUSE callbacks like a loopback with a notification mechanism. After no real disk access after a short period of time (like 500ms) we'll trigger a call to p4 reconcile. The "interface" to this application is currently just a file handle: /.status - Lists "ok" if there's no errors, otherwise, outputs a list of messages |
||
#2 | 16208 | tjuricek |
Naive implementation that adds guesses at rename and unlink abilities. It's becoming *very* apparent that we need a different approach to handling file system events. We likely need to create a log of "here's what I've done" and then after a certain period of time trigger a system that allows you to possibly just reconcile the changes. Matching filesystem calls to p4 commands ends up with *a lot* of p4 commands. |
||
#1 | 16129 | tjuricek |
Rename/move files again... this time to the hyphenated-approach. |
||
//guest/tjuricek/file_system_client/main/Workspace.h | |||||
#1 | 16119 | tjuricek | Rename/move to meet workshop project conventions. | ||
//guest/tjuricek/fsclient/Workspace.h | |||||
#1 | 16118 | tjuricek |
FSClient initial version: handles add, edit This is a proof-of-concept app that mirrors an existing Perforce workspace to handle running commands like "p4 add" and "p4 edit" automatically when your apps add and write files. See the readme for more information. |