Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.4.3] - 2024-06-20

### Added

- Changed the default ignore.conf to not ignore itself
- Added "Undo unchanged" and "Undo checkouts keeping changes" options to pending changes view
- Removed focus redirection after Check-in

### Fixed

- Moving folders in the Editor now correctly use the UVCS "Move" operation
- Fixed hang on domain reload
- Fixed "item with the same key has already been added" error
- Fixed failure to delete a .meta file when deleting a private folder from the pending changes
- Supported workspace name with non-latin characters in Pending Changes
- Fixed text cut-off in filter rules dialog
- Fixed unexpected error while switching between branches
- Fixed error after renaming a parent branch of the working branch
- Fixed variables's value becoming clear after resolving conflict in inspector
- Removed misleading indication about shelves
- Fixed column sorting in pending changes view
- Fixed missing incoming changes after removing a branch
- Fixed "Collection was modified" error when doing multiple renames in a row
- Fixed undo & check-in operations not working when the current scene was never saved
- Fixed check in error if nothing is selected in the pending changes tree
  • Loading branch information
Unity Technologies committed Jun 20, 2024
1 parent 84fa31c commit 2bfdef1
Show file tree
Hide file tree
Showing 206 changed files with 3,789 additions and 1,502 deletions.
2 changes: 2 additions & 0 deletions .buginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project: VCS
package: Unity Version Control package
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

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

## [2.4.3] - 2024-06-20

### Added

- Changed the default ignore.conf to not ignore itself
- Added "Undo unchanged" and "Undo checkouts keeping changes" options to pending changes view
- Removed focus redirection after Check-in

### Fixed

- Moving folders in the Editor now correctly use the UVCS "Move" operation
- Fixed hang on domain reload
- Fixed "item with the same key has already been added" error
- Fixed failure to delete a .meta file when deleting a private folder from the pending changes
- Supported workspace name with non-latin characters in Pending Changes
- Fixed text cut-off in filter rules dialog
- Fixed unexpected error while switching between branches
- Fixed error after renaming a parent branch of the working branch
- Fixed variables's value becoming clear after resolving conflict in inspector
- Removed misleading indication about shelves
- Fixed column sorting in pending changes view
- Fixed missing incoming changes after removing a branch
- Fixed "Collection was modified" error when doing multiple renames in a row
- Fixed undo & check-in operations not working when the current scene was never saved
- Fixed check in error if nothing is selected in the pending changes tree

## [2.3.1] - 2024-02-27

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 @@ -19,7 +45,6 @@ Removing a previously added Plastic SCM Asset Store Plug-In:

- Fixed DropdownField not working properly on a ModalUtility window on MacOS.
- Fixed issue with existing checkout operations locking the workspace.
- Retained locks prevented to checkout assets.
- Reviewed initialization and application lifecycle.
- Fixed layout error when switching checkout status in the inspector.
- Fixed Diff option unavailable for .prefab.
Expand All @@ -31,6 +56,7 @@ Removing a previously added Plastic SCM Asset Store Plug-In:
- Fixed finding changes operation being firing constantly.
- Removed obsolete content in package documentation.
- Fixed typo in locks tooltip.
- Replaced the text "plasticscm.com" by a https://unity.com/solutions/version-control in the package.json

## [2.2.0] - 2023-10-06

Expand Down
2 changes: 1 addition & 1 deletion Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Version Control package provides an integration of Unity Version Control (Unity VCS, formerly Plastic SCM) in the Unity Editor.

It is installed by default with the Editor, and follows the Unity support schedule. Currently, the minimum supported version of the Unity Editor is 2021.3 LTS.
It is installed by default with the Editor, and follows the Unity support schedule. Currently, the minimum supported version of the Unity Editor is 2020.3 LTS.

* [Quick start guide](QuickStartGuide.md)
* [Get started with Unity Version Control](GetStarted.md)
22 changes: 16 additions & 6 deletions Editor/PlasticSCM/AssetMenu/AssetMenuItems.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEditor.VersionControl;

using Codice.CM.Common;
using Codice.Client.Common.EventTracking;
using Codice.LogWrapper;
using PlasticGui;
using PlasticGui.WorkspaceWindow.Items;
using Unity.PlasticSCM.Editor.AssetsOverlays.Cache;
Expand All @@ -21,6 +21,8 @@ internal static void Enable(
if (mIsEnabled)
return;

mLog.Debug("Enable");

mWkInfo = wkInfo;
mAssetStatusCache = assetStatusCache;

Expand All @@ -37,6 +39,8 @@ internal static void Enable(

internal static void Disable()
{
mLog.Debug("Disable");

mIsEnabled = false;

RemoveMenuItems();
Expand All @@ -63,7 +67,6 @@ internal static void BuildOperations(
IMergeViewLauncher mergeViewLauncher,
PlasticGui.Gluon.IGluonViewSwitcher gluonViewSwitcher,
LaunchTool.IShowDownloadPlasticExeWindow showDownloadPlasticExeWindow,
EditorWindow parentWindow,
bool isGluonMode)
{
if (!mIsEnabled)
Expand All @@ -80,7 +83,6 @@ internal static void BuildOperations(
mAssetStatusCache,
mergeViewLauncher,
gluonViewSwitcher,
parentWindow,
mAssetSelection,
showDownloadPlasticExeWindow,
isGluonMode);
Expand Down Expand Up @@ -304,7 +306,13 @@ static string GetPlasticMenuItemName(PlasticLocalization.Name name)
static IAssetStatusCache mAssetStatusCache;
static WorkspaceInfo mWkInfo;

const int BASE_MENU_ITEM_PRIORITY = 19; // Puts Plastic SCM right below Create menu
#if UNITY_6000_0_OR_NEWER
// Puts Unity Version Control in a new section, as it precedes the Create menu with the old value
const int BASE_MENU_ITEM_PRIORITY = 71;
#else
// Puts Unity Version Control right below the Create menu
const int BASE_MENU_ITEM_PRIORITY = 19;
#endif

// incrementing the "order" param by 11 causes the menu system to add a separator
const int PENDING_CHANGES_MENU_ITEM_PRIORITY = BASE_MENU_ITEM_PRIORITY;
Expand All @@ -316,5 +324,7 @@ static string GetPlasticMenuItemName(PlasticLocalization.Name name)
const int HIDDEN_MENU_ITEMS_PRIORITY = PENDING_CHANGES_MENU_ITEM_PRIORITY + 26;
const int DIFF_MENU_ITEM_PRIORITY = PENDING_CHANGES_MENU_ITEM_PRIORITY + 37;
const int HISTORY_MENU_ITEM_PRIORITY = PENDING_CHANGES_MENU_ITEM_PRIORITY + 38;

static readonly ILog mLog = PlasticApp.GetLogger("AssetMenuItems");
}
}
}
6 changes: 1 addition & 5 deletions Editor/PlasticSCM/AssetMenu/AssetOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ internal AssetOperations(
IAssetStatusCache assetStatusCache,
IMergeViewLauncher mergeViewLauncher,
IGluonViewSwitcher gluonViewSwitcher,
EditorWindow parentWindow,
IAssetSelection assetSelection,
LaunchTool.IShowDownloadPlasticExeWindow showDownloadPlasticExeWindow,
bool isGluonMode)
Expand All @@ -69,7 +68,6 @@ internal AssetOperations(
mAssetSelection = assetSelection;
mShowDownloadPlasticExeWindow = showDownloadPlasticExeWindow;
mIsGluonMode = isGluonMode;
mParentWindow = parentWindow;

mGuiMessage = new UnityPlasticGuiMessage();
mProgressControls = new EditorProgressControls(mGuiMessage);
Expand Down Expand Up @@ -155,7 +153,6 @@ void IAssetMenuOperations.Checkin()
selectedPaths,
mAssetStatusCache,
mIsGluonMode,
mParentWindow,
mWorkspaceWindow,
mViewHost,
mWorkspaceOperationsMonitor,
Expand Down Expand Up @@ -283,7 +280,7 @@ void IAssetFilesFilterPatternsMenuOperations.AddFilesFilterPatterns(

FilterRulesConfirmationData filterRulesConfirmationData =
FilterRulesConfirmationDialog.AskForConfirmation(
rules, isAddOperation, isApplicableToAllWorkspaces, mParentWindow);
rules, isAddOperation, isApplicableToAllWorkspaces, null);

AddFilesFilterPatternsOperation.Run(
mWkInfo, mWorkspaceWindow, type, operation, filterRulesConfirmationData);
Expand Down Expand Up @@ -324,7 +321,6 @@ static string GetSymbolicName(string selectedPath)
readonly bool mIsGluonMode;
readonly GuiMessage.IGuiMessage mGuiMessage;
readonly EditorProgressControls mProgressControls;
readonly EditorWindow mParentWindow;
readonly IAssetSelection mAssetSelection;
readonly LaunchTool.IShowDownloadPlasticExeWindow mShowDownloadPlasticExeWindow;
}
Expand Down
9 changes: 3 additions & 6 deletions Editor/PlasticSCM/AssetMenu/Dialogs/CheckinDialog.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;

using UnityEditor;
Expand Down Expand Up @@ -45,7 +44,6 @@ internal static bool CheckinPaths(
List<string> paths,
IAssetStatusCache assetStatusCache,
bool isGluonMode,
EditorWindow parentWindow,
IWorkspaceWindow workspaceWindow,
ViewHost viewHost,
WorkspaceOperationsMonitor workspaceOperationsMonitor,
Expand All @@ -70,13 +68,12 @@ internal static bool CheckinPaths(
mergeViewLauncher,
gluonViewSwitcher);

return dialog.RunModal(parentWindow) == ResponseType.Ok;
return dialog.RunModal(null) == ResponseType.Ok;
}

protected override void OnModalGUI()
{
Title(PlasticLocalization.GetString(
PlasticLocalization.Name.CheckinComment));
Title(PlasticLocalization.GetString(PlasticLocalization.Name.CheckinOnlyComment));

GUI.SetNextControlName(CHECKIN_TEXTAREA_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Codice.Client.Common.Threading;
using Codice.Client.GameUI.Checkin;
using Codice.CM.Common;
using Codice.CM.Common.Checkin.Partial;

using GluonGui;

Expand Down
93 changes: 2 additions & 91 deletions Editor/PlasticSCM/AssetOverlays/Cache/LockStatusCache.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System;
using System.Collections.Generic;
using System.IO;

using Codice;
using Codice.Client.Commands;
using Codice.Client.Commands.Mount;
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.CM.Common.Mount;
using Codice.Utils;
using PlasticGui.WorkspaceWindow;
using PlasticGui.WorkspaceWindow.Items.Locks;

namespace Unity.PlasticSCM.Editor.AssetsOverlays.Cache
{
Expand Down Expand Up @@ -120,95 +120,6 @@ void AsyncCalculateStatus(CancelToken cancelToken)
});
}

static class FillLockCandidates
{
internal static void ForTree(
WorkspaceInfo wkInfo,
Dictionary<MountPointWithPath, List<WorkspaceTreeNode>> lockCandidates)
{
WorkspaceTreeNode rootNode = CmConnection.Get().GetWorkspaceTreeHandler().
GetWorkspaceTree(wkInfo, wkInfo.ClientPath, true);

Queue<NodeWithPath> pendingDirectories = new Queue<NodeWithPath>();
pendingDirectories.Enqueue(new NodeWithPath(
MountPointWithPath.BuildWorkspaceRootMountPoint(rootNode.RepSpec),
rootNode, wkInfo.ClientPath));

while (pendingDirectories.Count > 0)
{
NodeWithPath directoryNode = pendingDirectories.Dequeue();

ForChildren(
wkInfo.ClientPath,
directoryNode.Mount,
directoryNode.Path,
directoryNode.Node,
pendingDirectories,
lockCandidates);
}
}

static void ForChildren(
string wkPath,
MountPointWithPath parentMount,
string dirPath,
WorkspaceTreeNode dirNode,
Queue<NodeWithPath> pendingDirectories,
Dictionary<MountPointWithPath, List<WorkspaceTreeNode>> lockCandidates)
{
if (!dirNode.HasChildren)
return;

foreach (WorkspaceTreeNode child in dirNode.Children)
{
string childPath = Path.Combine(dirPath, child.Name);

if (CheckWorkspaceTreeNodeStatus.IsDirectory(child))
{
MountPointWithPath mount = XlinkWorkspaceTreeNode.IsXlinkWkNode(child) ?
new MountPointWithPath(
MountPointId.BuildForXlink(
((XlinkWorkspaceTreeNode)child).Xlink.GUID, parentMount.Id),
child.RepSpec,
WorkspacePath.CmPathFromWorkspacePath(childPath, wkPath)) :
parentMount;

pendingDirectories.Enqueue(
new NodeWithPath(mount, child, childPath));
continue;
}

if (CheckWorkspaceTreeNodeStatus.IsAdded(child))
continue;

List<WorkspaceTreeNode> nodes = null;
if (!lockCandidates.TryGetValue(parentMount, out nodes))
{
nodes = new List<WorkspaceTreeNode>();
lockCandidates.Add(parentMount, nodes);
}

nodes.Add(child);
}
}

class NodeWithPath
{
internal readonly MountPointWithPath Mount;
internal readonly WorkspaceTreeNode Node;
internal readonly string Path;
internal NodeWithPath(
MountPointWithPath mount,
WorkspaceTreeNode node,
string path)
{
Mount = mount;
Node = node;
Path = path;
}
}
}

static class BuildStatusByNodeCache
{
internal static Dictionary<string, LockStatusData> ForLocks(
Expand Down
5 changes: 4 additions & 1 deletion Editor/PlasticSCM/AssetOverlays/Cache/RemoteStatusCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
using Codice.Client.GameUI.Update;
using Codice.CM.Common;
using Codice.CM.Common.Merge;
using Codice.CM.Common.Mount;
using Codice.CM.Common.Partial;
using Codice.CM.Common.Update.Partial;
using Codice.Utils;
using GluonGui.WorkspaceWindow.Views;

Expand Down Expand Up @@ -118,7 +121,7 @@ internal static Dictionary<string, AssetStatus> ForOutOfDateItems(
return result;

foreach (OutOfDateItemsByMount diffs in
outOfDateItems.GetOutOfDateItemsByMountList())
outOfDateItems.GetOutOfDateItemsByMountList(PathHelper.GetPathSorter()))
{
foreach (Difference diff in diffs.Changed)
{
Expand Down
Loading

0 comments on commit 2bfdef1

Please sign in to comment.