@@ -14,26 +14,26 @@ protected function configure()
1414 {
1515 $ this ->setName ('version:restore ' );
1616 $ this ->setDescription ('Restore a node version ' );
17- $ this ->addArgument ('absPath ' , null , InputArgument::REQUIRED , 'Absolute path to node ' );
17+ $ this ->addArgument ('path ' , null , InputArgument::REQUIRED , 'Path to node ' );
1818 $ this ->addArgument ('versionName ' , null , InputArgument::REQUIRED , 'Name of version to retore ' );
1919 $ this ->addOption ('remove-existing ' , null , InputOption::VALUE_NONE , 'Flag that governs what happens in case of identifier collision ' );
2020 $ this ->setHelp (<<<HERE
2121Attempt to restore an old version of a node.
2222
23- <em>If <info>absPath </info> is given and <info>versionName</info> is a version name:</em>
24- Restores the node at <info>absPath </info> to the state defined by the version with
23+ <em>If <info>path </info> is given and <info>versionName</info> is a version name:</em>
24+ Restores the node at <info>path </info> to the state defined by the version with
2525 the specified version name (<info>versionName</info>).
26- This method will work regardless of whether the node at absPath is
26+ This method will work regardless of whether the node at path is
2727 checked-in or not.
2828
2929
30- <em>If <info>absPath </info> is given and <info>versionName</info> is a VersionInterface instance:
30+ <em>If <info>path </info> is given and <info>versionName</info> is a VersionInterface instance:
3131</em>
32- Restores the specified version to <info>absPath </info>. There must be no existing
33- node at <info>absPath </info>. If one exists, a VersionException is thrown.
34- There must be a parent node to the location at <info>absPath </info>, otherwise a
32+ Restores the specified version to <info>path </info>. There must be no existing
33+ node at <info>path </info>. If one exists, a VersionException is thrown.
34+ There must be a parent node to the location at <info>path </info>, otherwise a
3535 PathNotFoundException is thrown.
36- If the would-be parent of the location <info>absPath </info> is actually a property,
36+ If the would-be parent of the location <info>path </info> is actually a property,
3737 or if a node type restriction would be violated, then a
3838 ConstraintViolationException is thrown.
3939
@@ -71,7 +71,7 @@ protected function configure()
7171subgraphs that has the same identifier as one of the nodes that would be
7272introduced by the restore operation into one of these subgraphs.
7373Else, an identifier collision occurs when a node exists outside the
74- subgraph rooted at absPath with the same identifier as a node that would
74+ subgraph rooted at path with the same identifier as a node that would
7575be introduced by the restore operation into the affected subgraph.
7676The result in such a case is governed by the removeExisting flag. If
7777<info>removeExisting</info> is true, then the incoming node takes precedence, and the
@@ -93,12 +93,13 @@ protected function configure()
9393
9494 public function execute (InputInterface $ input , OutputInterface $ output )
9595 {
96- $ absPath = $ input ->getArgument ('absPath ' );
96+ $ session = $ this ->getHelper ('phpcr ' )->getSession ();
97+
98+ $ path = $ session ->getAbsPath ($ input ->getArgument ('path ' ));
9799 $ versionName = $ input ->getArgument ('versionName ' );
98100 $ removeExisting = $ input ->getOption ('remove-existing ' );
99- $ session = $ this ->getHelper ('phpcr ' )->getSession ();
100101 $ workspace = $ session ->getWorkspace ();
101102 $ versionManager = $ workspace ->getVersionManager ();
102- $ versionManager ->restore ($ removeExisting , $ versionName , $ absPath );
103+ $ versionManager ->restore ($ removeExisting , $ versionName , $ path );
103104 }
104105}
0 commit comments