// // PLSConnection.h // Pulse // // Created by Matt Attaway on 2/1/14. // Copyright (c) 2014 Zen of the Monkey. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_OPTIONS(NSUInteger, P4ConnectionReconcileOptions) { P4ConnectionReconcileAddOption = 0x00000001, P4ConnectionReconcileEditOption = 0x00000002, P4ConnectionReconcileDeleteOption = 0x00000004 }; typedef NS_OPTIONS(NSUInteger, P4ConnectionRevertOptions) { P4ConnectionRevertServerOnlyOption = 0x00000001 }; @class P4Message; @interface P4Connection : NSObject @property (strong) NSString* port; @property (strong) NSString* user; @property (strong) NSString* client; @property (strong) NSString* path; @property (strong) NSString* p4path; @property (strong) NSString* charset; - (id)initWithSettings:(NSString*)port user:(NSString*)user client:(NSString*)client path:(NSString*)path charset:(NSString*)charset; - (P4Message*)reconcilePath:(NSString*)path options:(NSUInteger)opts; - (P4Message*)reconcilePaths:(NSArray*)paths options:(NSUInteger)opts; - (P4Message*)revertPath:(NSString*)path options:(NSUInteger)opts; - (P4Message*)revertPaths:(NSArray*)paths options:(NSUInteger)opts; - (P4Message*)submit:(NSString*)description; - (P4Message*)syncFiles:(NSString*)path; - (P4Message*)getLatestChangeInClient; - (P4Message*)getChanges:(NSInteger)high low:(NSInteger)low; - (P4Message*)login:(NSString*)password; - (BOOL)isConnected; - (BOOL)isLoggedIn; @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#11 | 8723 | Matt Attaway |
Continuously update state on opened files Automatically checking out files is all well and good, but there’s a problem; frequently in the course of working on files, before you commit, files will go through a number of different states. You may edit a file, then delete it, and then re-add it unchanged all before trying to commit. At the end of the process in the case above nothing should happen, but if you edit a file and never revisit it you are stuck with that initial edit. Pulse now runs a non-destructive revert on files when it receives an event notification. This resets the working state so that if there is a major change (from edit -> delete) we can properly catch it and tell the system. It also is handy for dealing with added files that you then delete. There are edge cases with this code that I’m confident are not handled correctly. The good news is nothing should be destructive; the worse that happens is you revert -k everything and re-run reconcile. User visible change |
||
#10 | 8722 | Matt Attaway |
Optimize reconcile calls to minimize file scans The FSEvents API gives wonderfully detailed information which allows us to be a bit more precise in how we run reconcile. Now we only look for edited files if one of the files was flagged as modified. No user visible change (fairly subtle optimization) |
||
#9 | 8720 | Matt Attaway |
Rework reconcile methods to handle file arguments Previously the only option was to blindly reconcile the world. Now reconciles can be more targeted, although there’s no code to actually do a targeted reconcile yet in the Overseer. Infrastructure only change |
||
#8 | 8698 | Matt Attaway |
Add a method to run revert -k. Will hook up later into the reconcile code |
||
#7 | 8692 | Matt Attaway |
Add auto-submit capability to Pulse If you so choose you may now configure Pulse to automatically submit files as soon as they are changed. This is done as part of the file event watcher; files are opened with reconcile and if configured to do so immediately submitted with a boilerplate commit message. For obvious reasons auto-commit is off by default. User visible change |
||
#6 | 8657 | Matt Attaway |
Tidy up constructors and whitespace a bit Finally figured out the proper way to have a designated contructor in Obj-C. Hooray for progress. No user visible change. |
||
#5 | 8652 | Matt Attaway |
Rework login to take advantage of other clients logging in Previously the Overseer entirely shut down operations when it noticed that the user needed to login. This is all well and good if you only use Pulse, but less helpful if use other clients too. This change introduces a new timer that attempts ‘p4 login -s’ every few seconds to see if there is a valid ticket. This is not unlike the timer that gets enabled when a connection is lost. This change also includes some WIP on submit support that I was too lazy to pull out. User visible changelist |
||
#4 | 8597 | Matt Attaway |
Handle disconnected servers automatically If Pulse loses its connection with the Perforce server it now reports that the connection is down and starts a new timer to look for a live connection. The Overseer handles all of this on its own; unlike login there’s really nothing for the user to do. This change also fixes a bug where the login dialog was not being properly regenerated for connections after the first. User visible change |
||
#3 | 8590 | Matt Attaway |
Add crude login capabilities This is the first step toward getting the login behavior I want. Right now anytime a Peforce command gets a login error the Overseer ion charge notifies its delegate, which is currently the AppDelegate. The AppDelegate then kicks off the requisite login dialog which gets the password and does the login. There’s no error handling or feedback and the dialog pops up even when it is a background process that hit the error. The next step is to implement the Login menu item and the ‘need login’ tool tip and status icon. User visible (and possibly user annoying) change |
||
#2 | 8571 | Matt Attaway |
Expand connection properties for charset; add method to crudely handle common errors This is the next step towards handling login and unicode errors. The interfaces have been widened to track the charset. I’m using a string at this point so that I can just pass in the character set without having to test it; ‘none’ works with non-Unicode servers. The handler just logs what it would do so that I can test the behavior. Next step is to actually ask the user for their password and run login. Still no real functional change. |
||
#1 | 8569 | Matt Attaway |
Rejigger P4Connection to use a standard return type The previous mechanism made it hard to return anything but error messages. With the P4Message object we can return dictionaries, lists, and messages with a single object. I can use the new object more intelligently, but that’s for another change. I also reorganized the code to separate the ‘p4’ layer off into its own potentially reusable bucket. No functional change. |
||
//guest/matt_attaway/Pulse/Pulse/PLSConnection.h | |||||
#2 | 8527 | Matt Attaway |
Improve query efficiency and improve feedback to user This change adds a check for the highest synced changed. Instead of blindly running sync over and over Pulse now runs ‘p4 changes -m 1 //<client>/...' and if the number is higher than the stored value it runs sync and then stores the new highest change. Highest change numbers are written to the preferences to further reduce needless queries. With this change we also fetch the list of changes between the previous high change and the new one so that we can report the number of changes synced. |
||
#1 | 8525 | Matt Attaway |
Refactor the Perforce interaction out of the Overseer into a separate class No functional change, hopefully. This should just simplify the Overseer code and set me up to have a proper place to run Perforce commands. |