Skip to content

Commit ee22142

Browse files
committed
Various fixes:
Closes #146, #148
1 parent 0f42bea commit ee22142

13 files changed

+40
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ dev-master
1616
- [embedded] No exit code returned
1717
- [profile] Profile configuration overwritten by session parameters
1818
- [node:list] Incorrect node count
19+
- [node:edit] Multivalue references encoded as arrays when editing
20+
- [node:edit] Fixed undefined variable
21+
- [version] Versioning commands can use relative paths
1922

2023
beta1
2124
-----

features/all/phpcr_version_history.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Feature: Node Version History
77
Given that I am logged in as "testuser"
88
And the "versionable.xml" fixtures are loaded
99

10-
Scenario: Checkout a a given node
11-
Given I execute the "version:history /tests_version_base/versioned" command
10+
Scenario: Show history for a node
11+
When I execute the "version:history /tests_version_base/versioned" command
1212
Then the command should not fail
1313
And I should see a table containing the following rows:
1414
| Name | Created |
1515

1616
Scenario: History on a non versionable node
17-
Given I execute the "version:history /tests_version_base" command
17+
When I execute the "version:history /tests_version_base" command
1818
Then the command should fail
1919
And I should see the following:
2020
"""

features/all/phpcr_version_remove.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Remove node version
88
And the "versionable.xml" fixtures are loaded
99

1010
Scenario: Checkout a a given node
11-
Given I execute the following commands:
11+
When I execute the following commands:
1212
| cd /tests_version_base/versioned |
1313
| version:checkout /tests_version_base/versioned |
1414
| node:property:set foo baz |
@@ -21,7 +21,7 @@ Feature: Remove node version
2121
And I execute the "version:remove /tests_version_base/versioned 1.0" command
2222
Then the command should not fail
2323
And I execute the "version:history /tests_version_base/versioned" command
24-
Then I should not see the following:
24+
And I should not see the following:
2525
"""
2626
| 1.0 |
2727
"""

features/all/phpcr_version_restore.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Restore a version
88
And the "versionable.xml" fixtures are loaded
99

1010
Scenario: Restore node version
11-
Given I execute the following commands:
11+
When I execute the following commands:
1212
| cd /tests_version_base/versioned |
1313
| node:property:set foo initalbar |
1414
| session:save |

src/PHPCR/Shell/Config/ProfileLoader.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,15 @@ public function loadProfile(Profile $profile)
8080
$profile->set('transport', $data['transport']);
8181
}
8282

83+
$profileWorkspace = $profile->get('phpcr', 'workspace');
8384
if (isset($data['phpcr'])) {
8485
$profile->set('phpcr', $data['phpcr']);
8586
}
87+
88+
// workspace argument overrides profile workspace
89+
if ($profileWorkspace && $profileWorkspace !== 'default') {
90+
$profile->set('phpcr', 'workspace', $profileWorkspace);
91+
}
8692
}
8793

8894
public function saveProfile(Profile $profile, $overwrite = false)

src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function execute(InputInterface $input, OutputInterface $output)
4646

4747
$workspace = $session->getWorkspace();
4848

49+
$start = microtime(true);
4950
$workspace->copy($srcAbsPath, $destAbsPath, $srcWorkspace);
51+
$end = microtime(true) - $start;
52+
$output->writeln(number_format($end, 6));
5053
}
5154
}

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function execute(InputInterface $input, OutputInterface $output)
6868
$node = $session->getNodeByPathOrIdentifier($path);
6969
$nodeHelper->assertNodeIsVersionable($node);
7070

71-
$version = $versionManager->checkin($path);
71+
$version = $versionManager->checkin($node->getPath());
7272

7373
$output->writeln('Version: ' . $version->getName());
7474
}

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public function execute(InputInterface $input, OutputInterface $output)
5454
$nodeHelper->assertNodeIsVersionable($node);
5555

5656
$versionManager = $workspace->getVersionManager();
57-
$version = $versionManager->checkout($absPath);
57+
$version = $versionManager->checkout($node->getPath());
5858
}
5959
}

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4343
$node = $session->getNodeByPathOrIdentifier($path);
4444
$nodeHelper->assertNodeIsVersionable($node);
4545
$versionManager = $workspace->getVersionManager();
46-
$version = $versionManager->checkpoint($path);
46+
$version = $versionManager->checkpoint($node->getPath());
4747

4848
$output->writeln('Version: ' . $version->getName());
4949
}

src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ public function execute(InputInterface $input, OutputInterface $output)
4040
$workspace = $session->getWorkspace();
4141

4242
$node = $session->getNodeByPathOrIdentifier($path);
43+
4344
$nodeHelper->assertNodeIsVersionable($node);
4445
$versionManager = $workspace->getVersionManager();
45-
$history = $versionManager->getVersionHistory($path);
46+
$history = $versionManager->getVersionHistory($node->getPath());
4647

4748
$versions = $history->getAllVersions();
4849

0 commit comments

Comments
 (0)