Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.2.0] - 2023-10-06

Unity Version Control is now available as part of the Version Control Package! You can enable Unity Version Control via Window > Unity Version Control to get started!
If you have previously used the Unity Asset Store Plastic SCM plug-in, you can now simply use this package. Make sure you delete the plug-in from your project.
Removing a previously added Plastic SCM Asset Store Plug-In:

- Select the PlasticSCM folder in the Assets\Plugins folder on the Project tab, then click Edit > Delete
- Close the Unity Editor and open your project again. You will find the Plastic SCM menu item in the Window menu.

### Added

- Added button for organization owner/admins to upgrade to DevOps subscription.
- Included new decorators for retained & locked files.

### Changed

- Updated description in the package.json, including an updated link to get started.

### Fixed

- Fixed failed operations when the workspace is already locked.
  • Loading branch information
Unity Technologies committed Oct 6, 2023
1 parent 846374c commit ca686a8
Show file tree
Hide file tree
Showing 135 changed files with 1,148 additions and 433 deletions.
38 changes: 33 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this package will be documented in this file.

## [2.2.0] - 2023-10-06

Unity Version Control is now available as part of the Version Control Package! You can enable Unity Version Control via Window > Unity Version Control to get started!
If you have previously used the Unity Asset Store Plastic SCM plug-in, you can now simply use this package. Make sure you delete the plug-in from your project.
Removing a previously added Plastic SCM Asset Store Plug-In:

- Select the PlasticSCM folder in the Assets\Plugins folder on the Project tab, then click Edit > Delete
- Close the Unity Editor and open your project again. You will find the Plastic SCM menu item in the Window menu.

### Added

- Added button for organization owner/admins to upgrade to DevOps subscription.
- Included new decorators for retained & locked files.

### Changed

- Updated description in the package.json, including an updated link to get started.

### Fixed

- Fixed failed operations when the workspace is already locked.

## [2.1.0] - 2023-09-01

Unity Version Control is now available as part of the Version Control Package! You can enable Unity Version Control via Window > Unity Version Control to get started!
Expand All @@ -11,14 +33,20 @@ Removing a previously added Plastic SCM Asset Store Plug-In:
- Select the PlasticSCM folder in the Assets\Plugins folder on the Project tab, then click Edit > Delete
- Close the Unity Editor and open your project again. You will find the Plastic SCM menu item in the Window menu.

Changed:
### Added

- Moved the button to invite users to the organization from the submenu to the toolbar.
- Added command to support Hub creating a new project, and connecting a project to Unity Version Control.
- Show a message with a link to invite users to the organization after the first checkin.

### Changed

- Moved the button to invite users to the organization from the submenu to the toolbar.

### Removed

- Don't write cloudProjectId in ProjectSettings.asset anymore since it should only be managed by Services.
- Added command to support Hub creating a new project, and connecting a project to Unity Version Control.

Fixed:
### Fixed

- Fixed Add to ignored/hidden changes list from the Project window creating a negative rule.
- Fixed Switch to changeset not working on Gluon partial workspace.
Expand All @@ -32,7 +60,7 @@ Removing a previously added Plastic SCM Asset Store Plug-In:
- Select the PlasticSCM folder in the Assets\Plugins folder on the Project tab, then click Edit > Delete
- Close the Unity Editor and open your project again. You will find the Plastic SCM menu item in the Window menu.

Fixed:
### Fixed

- Fixed the Unity Version Control icon disappearing from the Editor Toolbar on domain reload.
- Fixed the popup stating "An existing checkout operation has locked the workspace" when trying to check in a scene with unsaved changes.
Expand Down
8 changes: 1 addition & 7 deletions Documentation~/QuickStartGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ The Version Control package will allow you to use Unity Version Control (Unity V

Unity VCS integrates version control in Unity that will abstract version control complexity. It will also enable you to work collaboratively on more complex projects by providing additional VCS features such as branching, locking, merging, and a standalone GUI.

The Version Control package follows the Unity support schedule. Currently, supported versions are:

* 2020.3
* 2021.3
* 2022.3
* 2023.1
* 2023.2
The Version Control package follows the Unity support schedule. Currently, the minimum supported version of the Unity Editor is 2021.3 LTS.

[Getting started with Unity version control](StartPlasticForUnity.md)
3 changes: 3 additions & 0 deletions Editor/PlasticSCM/AssetMenu/AssetMenuItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using PlasticGui;
using PlasticGui.WorkspaceWindow.Items;
using Unity.PlasticSCM.Editor.AssetsOverlays.Cache;
using Unity.PlasticSCM.Editor.AssetUtils.Processor;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.Tool;

Expand Down Expand Up @@ -56,6 +57,7 @@ internal static void BuildOperations(
IViewSwitcher viewSwitcher,
IHistoryViewLauncher historyViewLauncher,
GluonGui.ViewHost viewHost,
WorkspaceOperationsMonitor workspaceOperationsMonitor,
PlasticGui.WorkspaceWindow.NewIncomingChangesUpdater incomingChangesUpdater,
IAssetStatusCache assetStatusCache,
IMergeViewLauncher mergeViewLauncher,
Expand All @@ -73,6 +75,7 @@ internal static void BuildOperations(
viewSwitcher,
historyViewLauncher,
viewHost,
workspaceOperationsMonitor,
incomingChangesUpdater,
mAssetStatusCache,
mergeViewLauncher,
Expand Down
28 changes: 17 additions & 11 deletions Editor/PlasticSCM/AssetMenu/AssetOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Unity.PlasticSCM.Editor.AssetMenu.Dialogs;
using Unity.PlasticSCM.Editor.AssetsOverlays.Cache;
using Unity.PlasticSCM.Editor.AssetUtils;
using Unity.PlasticSCM.Editor.AssetUtils.Processor;
using Unity.PlasticSCM.Editor.Tool;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.Views.PendingChanges.Dialogs;
Expand All @@ -45,6 +46,7 @@ internal AssetOperations(
IViewSwitcher viewSwitcher,
IHistoryViewLauncher historyViewLauncher,
ViewHost viewHost,
WorkspaceOperationsMonitor workspaceOperationsMonitor,
NewIncomingChangesUpdater newIncomingChangesUpdater,
IAssetStatusCache assetStatusCache,
IMergeViewLauncher mergeViewLauncher,
Expand All @@ -59,6 +61,7 @@ internal AssetOperations(
mViewSwitcher = viewSwitcher;
mHistoryViewLauncher = historyViewLauncher;
mViewHost = viewHost;
mWorkspaceOperationsMonitor = workspaceOperationsMonitor;
mNewIncomingChangesUpdater = newIncomingChangesUpdater;
mAssetStatusCache = assetStatusCache;
mMergeViewLauncher = mergeViewLauncher;
Expand Down Expand Up @@ -148,16 +151,17 @@ void IAssetMenuOperations.Checkin()
AssetMenuOperations.Checkin);

if (!CheckinDialog.CheckinPaths(
mWkInfo,
selectedPaths,
mAssetStatusCache,
mIsGluonMode,
mParentWindow,
mWorkspaceWindow,
mViewHost,
mGuiMessage,
mMergeViewLauncher,
mGluonViewSwitcher))
mWkInfo,
selectedPaths,
mAssetStatusCache,
mIsGluonMode,
mParentWindow,
mWorkspaceWindow,
mViewHost,
mWorkspaceOperationsMonitor,
mGuiMessage,
mMergeViewLauncher,
mGluonViewSwitcher))
return;

RefreshAsset.UnityAssetDatabase();
Expand All @@ -171,7 +175,8 @@ void IAssetMenuOperations.Undo()
mAssetStatusCache,
AssetMenuOperations.Undo);

SaveAssets.ForPathsWithoutConfirmation(selectedPaths);
SaveAssets.ForPathsWithoutConfirmation(
selectedPaths, mWorkspaceOperationsMonitor);

if (mIsGluonMode)
{
Expand Down Expand Up @@ -311,6 +316,7 @@ static string GetSymbolicName(string selectedPath)
readonly IHistoryViewLauncher mHistoryViewLauncher;
readonly IWorkspaceWindow mWorkspaceWindow;
readonly ViewHost mViewHost;
readonly WorkspaceOperationsMonitor mWorkspaceOperationsMonitor;
readonly NewIncomingChangesUpdater mNewIncomingChangesUpdater;
readonly IAssetStatusCache mAssetStatusCache;
readonly IMergeViewLauncher mMergeViewLauncher;
Expand Down
10 changes: 9 additions & 1 deletion Editor/PlasticSCM/AssetMenu/Dialogs/CheckinDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Unity.PlasticSCM.Editor.AssetsOverlays;
using Unity.PlasticSCM.Editor.AssetsOverlays.Cache;
using Unity.PlasticSCM.Editor.AssetUtils;
using Unity.PlasticSCM.Editor.AssetUtils.Processor;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Progress;
using Unity.PlasticSCM.Editor.UI.Tree;
Expand Down Expand Up @@ -47,6 +48,7 @@ internal static bool CheckinPaths(
EditorWindow parentWindow,
IWorkspaceWindow workspaceWindow,
ViewHost viewHost,
WorkspaceOperationsMonitor workspaceOperationsMonitor,
GuiMessage.IGuiMessage guiMessage,
IMergeViewLauncher mergeViewLauncher,
IGluonViewSwitcher gluonViewSwitcher)
Expand All @@ -63,6 +65,7 @@ internal static bool CheckinPaths(
new ProgressControlsForDialogs(),
workspaceWindow,
viewHost,
workspaceOperationsMonitor,
guiMessage,
mergeViewLauncher,
gluonViewSwitcher);
Expand Down Expand Up @@ -225,7 +228,9 @@ void DoCancelButton()
void OkButtonWithCheckinAction()
{
bool isCancelled;
SaveAssets.ForPathsWithConfirmation(mPaths, out isCancelled);
SaveAssets.ForPathsWithConfirmation(
mPaths, mWorkspaceOperationsMonitor,
out isCancelled);

if (isCancelled)
return;
Expand Down Expand Up @@ -268,6 +273,7 @@ static CheckinDialog Create(
ProgressControlsForDialogs progressControls,
IWorkspaceWindow workspaceWindow,
ViewHost viewHost,
WorkspaceOperationsMonitor workspaceOperationsMonitor,
GuiMessage.IGuiMessage guiMessage,
IMergeViewLauncher mergeViewLauncher,
IGluonViewSwitcher gluonViewSwitcher)
Expand All @@ -283,6 +289,7 @@ static CheckinDialog Create(
instance.mProgressControls = progressControls;
instance.mWorkspaceWindow = workspaceWindow;
instance.mViewHost = viewHost;
instance.mWorkspaceOperationsMonitor = workspaceOperationsMonitor;
instance.mGuiMessage = guiMessage;
instance.mMergeViewLauncher = mergeViewLauncher;
instance.mGluonViewSwitcher = gluonViewSwitcher;
Expand All @@ -308,6 +315,7 @@ static CheckinDialog Create(
ProgressControlsForDialogs mProgressControls;

IWorkspaceWindow mWorkspaceWindow;
WorkspaceOperationsMonitor mWorkspaceOperationsMonitor;
ViewHost mViewHost;
IMergeViewLauncher mMergeViewLauncher;
IGluonViewSwitcher mGluonViewSwitcher;
Expand Down
13 changes: 9 additions & 4 deletions Editor/PlasticSCM/AssetOverlays/AssetStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ internal enum AssetStatus
DeletedOnServer = 1 << 9,
Locked = 1 << 10,
LockedRemote = 1 << 11,
LockedRetained = 1 << 12,
Retained = 1 << 12,
HiddenChanged = 1 << 13,
}

internal class LockStatusData
{
internal readonly AssetStatus Status;
internal readonly string LockedBy;
internal readonly string WorkspaceName;
internal readonly string HolderBranchName;

internal LockStatusData(
AssetStatus status,
string lockedBy,
string workspaceName)
string holderBranchName)
{
Status = status;
LockedBy = lockedBy;
WorkspaceName = workspaceName;
HolderBranchName = holderBranchName;
}
}

Expand Down Expand Up @@ -65,6 +65,11 @@ internal static bool IsLockedRemote(AssetStatus status)
return ContainsAny(status, AssetStatus.LockedRemote);
}

internal static bool IsRetained(AssetStatus status)
{
return ContainsAny(status, AssetStatus.Retained);
}

internal static bool IsOutOfDate(AssetStatus status)
{
return ContainsAny(status, AssetStatus.OutOfDate);
Expand Down
30 changes: 15 additions & 15 deletions Editor/PlasticSCM/AssetOverlays/Cache/LockStatusCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using System.Collections.Generic;

using Codice;
using Codice.Client.BaseCommands;
using Codice.Client.Commands.WkTree;
using Codice.Client.Common;
using Codice.Client.Common.Locks;
using Codice.Client.Common.Threading;
using Codice.Client.Common.WkTree;
using Codice.CM.Common;
using Codice.Utils;
using PlasticGui.WorkspaceWindow;

namespace Unity.PlasticSCM.Editor.AssetsOverlays.Cache
{
Expand Down Expand Up @@ -198,22 +198,22 @@ static LockStatusData BuildLockStatusData(
LockInfo lockInfo,
LockOwnerNameResolver nameResolver)
{
AssetStatus status = AssetStatus.None;
// Filter the locks that are Retained since the plugin doesn't support them yet.
if (lockInfo.Status == LockInfo.LockStatus.Retained)
{
status = AssetStatus.LockedRetained;
}
else
{
status = CheckWorkspaceTreeNodeStatus.IsCheckedOut(node) ?
AssetStatus.Locked : AssetStatus.LockedRemote;
}

return new LockStatusData(
status,
GetAssetStatus(node, lockInfo),
nameResolver.GetSeidName(lockInfo.SEIDData),
LockWkInfo.GetWkCleanName(lockInfo));
BranchInfoCache.GetProtectedBranchName(
node.RepSpec, lockInfo.HolderBranchId));
}

static AssetStatus GetAssetStatus(
WorkspaceTreeNode node,
LockInfo lockInfo)
{
if (lockInfo.Status == LockInfo.LockStatus.Retained)
return AssetStatus.Retained;

return CheckWorkspaceTreeNodeStatus.IsCheckedOut(node) ?
AssetStatus.Locked : AssetStatus.LockedRemote;
}
}

Expand Down
20 changes: 11 additions & 9 deletions Editor/PlasticSCM/AssetOverlays/DrawAssetOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ internal static string GetStatusString(AssetStatus assetStatus)

if (ClassifyAssetStatus.IsLocked(assetStatus))
return PlasticLocalization.GetString(
PlasticLocalization.Name.StatusLockedMe);
PlasticLocalization.Name.StatusLockedByMe);

if (ClassifyAssetStatus.IsRetained(assetStatus))
return PlasticLocalization.GetString(
PlasticLocalization.Name.StatusRetained);

if (ClassifyAssetStatus.IsCheckedOut(assetStatus))
return PlasticLocalization.GetString(
Expand Down Expand Up @@ -118,8 +122,8 @@ internal static string GetTooltipText(
string line3 = string.Format("{0} {1}",
bulletCharacter,
PlasticLocalization.GetString(
PlasticLocalization.Name.AssetOverlayTooltipWorkspace,
lockStatusData.WorkspaceName));
PlasticLocalization.Name.AssetOverlayTooltipOn,
lockStatusData.HolderBranchName));

return string.Format(
"{0}" + Environment.NewLine +
Expand All @@ -146,14 +150,9 @@ static void OnProjectWindowItemGUI(string guid, Rect selectionRect)

AssetStatus assetStatus = mAssetStatusCache.GetStatus(fullPath);

LockStatusData lockStatusData =
ClassifyAssetStatus.IsLockedRemote(assetStatus) ?
mAssetStatusCache.GetLockStatusData(fullPath) :
null;

string tooltipText = GetTooltipText(
assetStatus,
lockStatusData);
mAssetStatusCache.GetLockStatusData(fullPath));

DrawOverlayIcon.ForStatus(
selectionRect,
Expand Down Expand Up @@ -211,6 +210,9 @@ internal static Texture GetOverlayIcon(AssetStatus assetStatus)
if (ClassifyAssetStatus.IsLocked(assetStatus))
return Images.GetLockedLocalOverlayIcon();

if (ClassifyAssetStatus.IsRetained(assetStatus))
return Images.GetRetainedOverlayIcon();

if (ClassifyAssetStatus.IsCheckedOut(assetStatus))
return Images.GetCheckedOutOverlayIcon();

Expand Down
Binary file added Editor/PlasticSCM/Assets/Images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ca686a8

Please sign in to comment.