Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.0.7] - 2023-07-25

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.

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.
  • Loading branch information
Unity Technologies committed Jul 25, 2023
1 parent b9895d6 commit 88f3584
Show file tree
Hide file tree
Showing 55 changed files with 1,881 additions and 963 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
# Changelog

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

## [2.0.7] - 2023-07-25

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.

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.

## [2.0.5] - 2023-05-31

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.

### Fixed

- Fixed remaining references to 'Plastic SCM' in localized labels.

## [2.0.4] - 2023-04-14

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:
Expand Down
13 changes: 6 additions & 7 deletions Documentation~/GitUsers.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Unity version control for Git users


| **GIT**| **Unity VC**| **Explanation**|
| **GIT**| **Unity VCS**| **Explanation**|
|:--|:--|:--|
| To Commit| To Check in| To Check in is to submit changes to the repo.|
| Commit| Changeset| Each new change on the history of the repo, grouping several individual file and directory changes.|
| Master| Main| When you create a repo in Unity VC, there's always an "empty" branch. Unity VC calls it Main.|
| To checkout | To update| Downloading content to the workspace (working copy). This is called "update" because in Unity VC, "checkout" has a different meaning.|
|| Checkout| When you checkout a file in Unity VC, you're saying you are going to modify the file.|
| Master| Main| When you create a repo in Unity VCS, there's always an "empty" branch. Unity VCS calls it Main.|
| To checkout | To update| Downloading content to the workspace (working copy). This is called "update" because in Unity VCS, "checkout" has a different meaning.|
|| Checkout| When you checkout a file in Unity VCS, you're saying you are going to modify the file.|
|| Exclusive checkout or lock | This is locking a file so nobody can touch it. It’s only useful for non-mergeable files, like binaries, images, or art in a video game.|
| Rebase|| Unity VC handles branching differently than Git. In Unity VC, a rebase is just a merge operation.|
| Rebase|| Unity VCS handles branching differently than Git. In Unity VCS, a rebase is just a merge operation.|
| Repository | Repository| Where the entire history of the project is stored.
| Working copy | Workspace| In Git, you have the working copy and the repository in the exact location. You have a working copy and a .git hidden dir with the repository. In Unity VC, this is slightly different since repositories and workspaces are separated. You can have several workspaces working with the same local repository.
| Working copy | Workspace| In Git, you have the working copy and the repository in the exact location. You have a working copy and a .git hidden dir with the repository. In Unity VCS, this is slightly different since repositories and workspaces are separated. You can have several workspaces working with the same local repository.
7 changes: 3 additions & 4 deletions Documentation~/QuickStartGuide.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Quick start guide

The Version Control package will allow you to use Unity version control for your projects in the Unity Editor.
The Version Control package will allow you to use Unity Version Control (Unity VCS) for your projects in the Unity Editor.

Unity VC 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.
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.2
* 2022.3
* 2023.1
* 2023.2


[Getting started with Unity version control](StartPlasticForUnity.md)
6 changes: 3 additions & 3 deletions Documentation~/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# About Version Control

The Version Control package provides an in-editor interface for teams to work with Unity version control (Unity VC).
## Unity VC
The Version Control package provides an in-editor interface for teams to work with Unity Version Control (Unity VCS).

Unity VC plug-in for Unity is a free Unity plug-in that gives you the ability to use Unity VC, a leading version control solution, directly in Unity. Get started with [Unity VC](QuickStartGuide.md).
## Unity Version Control

It is a free Unity plug-in that gives you the ability to use Unity VCS, a leading version control solution, directly in Unity. Get started with [Unity VCS](QuickStartGuide.md).
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/AssetMenu/AssetMenuItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEditor.VersionControl;

using Codice.CM.Common;
using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common.EventTracking;
using PlasticGui;
using PlasticGui.WorkspaceWindow.Items;
using Unity.PlasticSCM.Editor.AssetsOverlays.Cache;
Expand Down
8 changes: 5 additions & 3 deletions Editor/PlasticSCM/AssetMenu/AssetOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
using UnityEditor.VersionControl;

using Codice.Client.BaseCommands;
using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Commands;
using Codice.Client.Commands.WkTree;
using Codice.Client.Common;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
using GluonGui;
Expand Down Expand Up @@ -124,7 +124,8 @@ void IAssetMenuOperations.Checkout()
mGuiMessage,
selectedPaths.ToArray(),
false,
RefreshAsset.VersionControlCache);
RefreshAsset.VersionControlCache,
mWkInfo);
return;
}

Expand All @@ -134,7 +135,8 @@ void IAssetMenuOperations.Checkout()
mProgressControls,
selectedPaths,
mNewIncomingChangesUpdater,
RefreshAsset.VersionControlCache);
RefreshAsset.VersionControlCache,
mWkInfo);
}

void IAssetMenuOperations.Checkin()
Expand Down
3 changes: 2 additions & 1 deletion Editor/PlasticSCM/AssetMenu/Dialogs/CheckinDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
using UnityEditor;
using UnityEngine;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common;
using Codice.Client.Common.EventTracking;

using Codice.CM.Common;
using GluonGui;
using PlasticGui;
Expand Down
3 changes: 2 additions & 1 deletion Editor/PlasticSCM/AssetOverlays/AssetStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ internal enum AssetStatus
DeletedOnServer = 1 << 9,
Locked = 1 << 10,
LockedRemote = 1 << 11,
HiddenChanged = 1 << 12,
LockedRetained = 1 << 12,
HiddenChanged = 1 << 13,
}

internal class LockStatusData
Expand Down
13 changes: 11 additions & 2 deletions Editor/PlasticSCM/AssetOverlays/Cache/LockStatusCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,17 @@ static LockStatusData BuildLockStatusData(
LockInfo lockInfo,
LockOwnerNameResolver nameResolver)
{
AssetStatus status = CheckWorkspaceTreeNodeStatus.IsCheckedOut(node) ?
AssetStatus.Locked : AssetStatus.LockedRemote;
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,
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/AssetOverlays/Cache/SearchLocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void FillRepositoryLocks(
return;

Dictionary<Guid, LockInfo> serverlocksByItem =
ServerLocks.GetServerLocksByItem(
ServerLocks.GetLocksForServerByItemGuid(
repSpec.Server, locksByItemByServer);

if (serverlocksByItem == null || serverlocksByItem.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Threading;

using Codice;
using Codice.Client.BaseCommands;
using Codice.Client.Commands;
using Codice.Client.Commands.WkTree;
Expand Down Expand Up @@ -264,11 +265,23 @@ static void ProcessCheckoutOperation(
List<string> paths = ExtractPathsToProcess(
pathsToProcess, lockObj);

if (paths.Count == 0)
List<string> result = new List<string>();

foreach (string path in paths)
{
WorkspaceTreeNode node =
plasticApi.GetWorkspaceTreeNode(path);

if (node != null &&
!CheckWorkspaceTreeNodeStatus.IsCheckedOut(node))
result.Add(path);
}

if (result.Count == 0)
return;

plasticApi.Checkout(
paths.ToArray(),
result.ToArray(),
CheckoutModifiers.ProcessSymlinks);
}

Expand Down Expand Up @@ -483,12 +496,14 @@ internal static void CheckoutIfControlledAndChanged(
WorkspaceTreeNode nodeMeta =
plasticApi.GetWorkspaceTreeNode(metaPath);

if (node != null && ChangedFileChecker.IsChanged(
node.LocalInfo, path, false))
if (node != null &&
!CheckWorkspaceTreeNodeStatus.IsCheckedOut(node) &&
ChangedFileChecker.IsChanged(node.LocalInfo, path, false))
result.Add(path);

if (nodeMeta != null && ChangedFileChecker.IsChanged(
nodeMeta.LocalInfo, metaPath, false))
if (nodeMeta != null &&
!CheckWorkspaceTreeNodeStatus.IsCheckedOut(nodeMeta) &&
ChangedFileChecker.IsChanged(nodeMeta.LocalInfo, metaPath, false))
result.Add(metaPath);
}

Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/CollabMigration/MigrationDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using UnityEngine;

using Codice.Client.BaseCommands;
using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.BaseCommands.Sync;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
using Codice.LogWrapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using UnityEditor.IMGUI.Controls;

using Codice.Client.BaseCommands;
using Codice.Client.Commands;

namespace Unity.PlasticSCM.Editor.Developer.UpdateReport
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine;

using Codice.Client.BaseCommands;
using Codice.Client.Commands;
using Codice.Client.Common;
using Codice.CM.Common;
using Unity.PlasticSCM.Editor.UI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine;

using Codice.Client.BaseCommands;
using Codice.Client.Commands;
using Codice.Client.Common;
using Codice.CM.Common;
using PlasticGui;
Expand Down
1 change: 0 additions & 1 deletion Editor/PlasticSCM/PlasticApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using UnityEngine;

using Codice.Client.BaseCommands;
using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common;
using Codice.Client.Common.Connection;
using Codice.Client.Common.Encryption;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/PlasticConnectionMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using UnityEditor;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.Connection;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/PlasticProjectSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using UnityEngine;
using UnityEngine.UIElements;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Commands;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.FsNodeReaders;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/PlasticWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using UnityEditor;
using UnityEngine;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.FsNodeReaders.Watcher;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/Tool/LaunchTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Diagnostics;
using System.IO;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common.EventTracking;
using Codice.CM.Common;
using Codice.LogWrapper;
using Codice.Utils;
Expand Down
24 changes: 9 additions & 15 deletions Editor/PlasticSCM/Toolbar/ToolbarButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using PlasticGui;
using Unity.PlasticSCM.Editor;
using Unity.PlasticSCM.Editor.UI;

namespace Unity.Cloud.Collaborate
{
Expand All @@ -12,9 +11,7 @@ internal static class ToolbarBootstrap
{
static ToolbarBootstrap()
{
CooldownWindowDelayer cooldownInitializeAction = new CooldownWindowDelayer(
ToolbarButton.InitializeIfNeeded, UnityConstants.PLUGIN_DELAYED_INITIALIZE_INTERVAL);
cooldownInitializeAction.Ping();
ToolbarButton.InitializeIfNeeded();
}
}

Expand Down Expand Up @@ -46,20 +43,17 @@ void OnPlasticNotificationUpdated()

public override void OnGUI(Rect rect)
{
using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
{
Texture icon = PlasticPlugin.GetPluginStatusIcon();
EditorGUIUtility.SetIconSize(new Vector2(16, 16));

mButtonGUIContent.image = icon;
Texture icon = PlasticPlugin.GetPluginStatusIcon();
EditorGUIUtility.SetIconSize(new Vector2(16, 16));

if (GUI.Button(rect, mButtonGUIContent, "AppCommand"))
{
PlasticPlugin.OpenPlasticWindowDisablingOfflineModeIfNeeded();
}
mButtonGUIContent.image = icon;

EditorGUIUtility.SetIconSize(Vector2.zero);
if (GUI.Button(rect, mButtonGUIContent, "AppCommand"))
{
PlasticPlugin.OpenPlasticWindowDisablingOfflineModeIfNeeded();
}

EditorGUIUtility.SetIconSize(Vector2.zero);
}

static GUIContent mButtonGUIContent = new GUIContent(
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/Views/Changesets/ChangesetsTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using UnityEditor.IMGUI.Controls;
using UnityEngine;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Commands;
using Codice.Client.Common;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
using PlasticGui;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/Views/Changesets/ChangesetsViewMenu.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEditor;
using UnityEngine;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Common.EventTracking;
using Codice.CM.Common;
using PlasticGui.WorkspaceWindow.QueryViews.Changesets;
using PlasticGui;
Expand Down
2 changes: 1 addition & 1 deletion Editor/PlasticSCM/Views/Diff/DiffPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using UnityEditor.IMGUI.Controls;
using UnityEngine;

using Codice.Client.BaseCommands.EventTracking;
using Codice.Client.Commands;
using Codice.Client.Common;
using Codice.Client.Common.EventTracking;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
using PlasticGui;
Expand Down
Loading

0 comments on commit 88f3584

Please sign in to comment.