Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new View Locks window similar to the recent View Branches #107

Merged
merged 20 commits into from Feb 6, 2024

Conversation

SRombautsU
Copy link

@SRombautsU SRombautsU commented Jan 18, 2024

  • Add a new View Locks window similar to the recent View Branches
  • Fix existing lock list parser to filter upfront by --repository
  • Refactor FSmartLockInfoParser to use the new FPlasticSourceControlLock class
  • NOTE: --dateformat was added to smartlocks a couple of releases later in version 11.0.16.8133
  • New "GetLocks" operation, and binding to the existing PlasticSourceControlUtils::RunListSmartLocks()
  • Implement OnReleaseLocksClicked() and OnRemovedLocksClicked() with ExecuteUnlock()...
  • Also register for any source control change to detect new local locks on check-out, and release of them on check-in
  • Also display the current branch in the View locks window as it's important in the context
  • Micro optimization with reserve allocation on the XML branch parser
  • Change the "Unlock" operation to uses strings for ItemIds so they can include a branch spec: #br:
  • Refactor ParseFileinfoResults() to handle multiple matching locks in case of multiple destination branches
  • If there are multiple locks matching for a single path, concatenate all string informations (like the branch & owner) but leave the ItmeId to invalid if there are more than one: there would be no way to know which one to unlock from the context menu. Unlocking in such a case require using the View Locks window instead for disambiguation.
  • FPlasticSourceControlState::CanCheckout() now let the user try to checkout even if an asset is already checked-out elsewhere As with multiple destination branches it is possible to have as many locks on the same asset as destination branches.

image

@SRombautsU SRombautsU self-assigned this Jan 18, 2024
@SRombautsU SRombautsU force-pushed the 1004409-view-locks-window branch 8 times, most recently from 9743fdf to 867e1f3 Compare January 25, 2024 15:09
@SRombautsU SRombautsU marked this pull request as ready for review January 25, 2024 15:09
@SRombautsU SRombautsU force-pushed the 1004409-view-locks-window branch 6 times, most recently from 0c9c06c to 4639b34 Compare January 29, 2024 17:46
…ecuteUnlock()

Apply the same wording decided for the Unity Plugin, to both the new View Locks window but also the existing Locks context menu
… on check-out, and release of them on check-in
so they can include a branch spec: <ItemId>#br:<BranchName>
…case of multiple destination branches

If there are multiple locks matching for a single path, concatenate all string informations (like the branch & owner)
but leave the ItmeId to invalid if there are more than one: there would be no way to know which one to unlock from the context menu.
Unlocking in such a case require using the View Locks window instead for disambiguation.
…ckout even if an asset is already checked-out elsewhere

As with multiple destination branches it is possible to have as many locks on the same asset as destination branches.

Note: Ideally we would want to check explicitly if the other lock is "on the same destination branch" as the current branch,
but that's overly complex and not possible currently with cm.
…fix for the Unlock not updating file states

A) It now uses an exclusive if/else structure to differentiate the two use case, and simplify the case 2:
1. The View Locks window works with object specs using ItemIds and Branch names
2. While the context "Unlock" menu only fills in the Files (from Asset Paths given by Content Browser)

B) It now directly use ObjectSpecs already correctly formatted
… the Files variable

It's required to update status of files after the Unlock operation has been executed
@SRombautsU SRombautsU force-pushed the 1004409-view-locks-window branch 3 times, most recently from e16c4ab to 6ecbbea Compare February 2, 2024 16:39
…ment "--branch="

The unlock operation works on a per-branch basis when multiple Lock destinations are involved,
so we have to call "cm lock unlock" as many time with the correct set of locks!
…ningful changes to the Editor

Now PlasticSourceControlUtils::UpdateCachedStates() only reports that the cache was updated if the state changed in a meaningful way, useful to the Editor

Mainly for the purpose of updating Content Browser overlay icons
@SRombautsU SRombautsU force-pushed the 1004409-view-locks-window branch 2 times, most recently from d97fe5b to a67db35 Compare February 5, 2024 09:53
… appropriate InvalidateLocksCache()

Works with a with a Timestamp on one hand, and an InvalidateLocksCache() method to force refreshes after specific operations (CheckOut, CheckIn, Revert[All/Unchanged], Unlock) and when the user manually refreshes the Lock view
Copy link

@juliomaqueda juliomaqueda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @SRombautsU!

@juliomaqueda juliomaqueda merged commit 5773601 into master Feb 6, 2024
@juliomaqueda juliomaqueda deleted the 1004409-view-locks-window branch February 6, 2024 14:48
SRombautsU added a commit that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants