Fossil

Check-in [0b70cf6d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Contributing PowerShell script Set-ChildProject.ps1. This script wraps the code for converting a project into a child project into an easy to use PowerShell script. The script should be cross platform, but was only tested on Windows 10.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | windows-tools
Files: files | file ages | folders
SHA3-256: 0b70cf6d5758d7dac25b94565b01586140ab798f97b776e54e4464dccfd1a716
User & Date: ckennedy 2019-08-09 20:15:24
Context
2019-08-09
20:15
Contributing PowerShell script Set-ChildProject.ps1. This script wraps the code for converting a project into a child project into an easy to use PowerShell script. The script should be cross platform, but was only tested on Windows 10. Leaf check-in: 0b70cf6d user: ckennedy tags: windows-tools
18:14
Enhance markdown to use the same hyperlink target resolving logic as Fossil wiki. That means that wiki page names and check-in and ticket hashes can now be used as markdown hyperlink URLs. Also enhance markdown hyperlinks so that if the display text is an empty string, the URL is used as the display text. check-in: 774fb771 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added tools/Set-ChildProject.ps1.























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env pwsh

<#PSScriptInfo

.VERSION 1.0.0

.GUID 8c36fbf7-a306-4a88-85af-078fd9c91d0f

.AUTHOR Chris Kennedy

.COMPANYNAME Fossil-SCM.org

.COPYRIGHT 2019

.TAGS Fossil-SCM

.LICENSEURI https://fossil-scm.org/fossil/doc/trunk/COPYRIGHT-BSD2.txt

.PROJECTURI https://fossil-scm.org/fossil/doc/trunk/www/index.wiki

.ICONURI

.EXTERNALMODULEDEPENDENCIES

.REQUIREDSCRIPTS

.EXTERNALSCRIPTDEPENDENCIES

.RELEASENOTES
  2019-08-09 CJK Initial release to Fossil-SCM Project.

#>

<#

.Synopsis
  Sets the current Fossil Repository to be a Child Project.

.DESCRIPTION
  Execute only in a current checkout.  Should only be ran once after the
  initial clone of the Child Project.

  Use this when you clone a repository that you should not be pushing changes
  to, such as when a repository is being used to provide a fully templated
  project.

.LINK
  https://fossil-scm.org/fossil/doc/trunk/www/childprojects.wiki

.INPUTS
  None. You cannot pipe objects to Set-ChildProject.

.OUTPUTS
  None.

.Parameter Name
  Name of the Child Project.

#>
[CmdletBinding()]
Param(
  [Parameter(Mandatory=$true,Position=0)]
  [ValidateNotNullOrEmpty()]
  [string] $Name
)

$sql = @"
UPDATE config SET name='parent-project-code' WHERE name='project-code';
UPDATE config SET name='parent-project-name' WHERE name='project-name';
INSERT INTO config(name,value) VALUES('project-code',lower(hex(randomblob(20))));
INSERT INTO config(name,value) VALUES('project-name','$Name');
"@

$sql | fossil.exe sqlite3