SVK::Co...:Branch(3)

πŸ“¦
version 2.2.3 Β· 2 versions
, in fedora 43

πŸ’– SVK::Co...:Branch πŸ’–

okay bestie, gather round β€” this is the manual page for SVK::Command::Branch, the bit of SVK that lets you manage a project together with all its branches. No cap, it's the branch wrangler. πŸŽ€


✨ SYNOPSIS ✨

branch --create BRANCH [DEPOTPATH]

branch --list [--all]
branch --create BRANCH [--tag] [--local] [--switch-to] [--from|--from-tag BRANCH|TAG] [DEPOTPATH]
branch --move BRANCH1 BRANCH2
branch --merge BRANCH1 BRANCH2 ... TARGET
branch --checkout BRANCH [PATH] [DEPOTPATH]
branch --delete BRANCH1 BRANCH2 ...
branch --setup DEPOTPATH
branch --push [BRANCH]
branch --pull [BRANCH]
branch --offline [BRANCH]
branch --online [BRANCH]

🌸 OPTIONS 🌸

  • -l [--list] β€” lists out the branches for this project πŸ¦‹
  • --list-projects β€” lists the projects that are avaliable πŸ‘‘
  • --create β€” makes a brand new branch, main character moment ✨
  • --tag β€” creates it over in the tags directory instead πŸŽ€
  • --local β€” targets land in the local branch
  • --delete [--rm|del] β€” deletes the BRANCH(s), bye bestie πŸ’…
  • --checkout [--co] β€” checks out BRANCH right into the current directory
  • --switch-to β€” switches your current checkout over to a different branch (and yes, you can pair it with --create)
  • --merge β€” automatically merges every single change from BRANCH1, BRANCH2, etc, into TARGET
  • --project β€” tells it which target project name you mean
  • --push β€” moves your changes to wherever this branch was originally copied from
  • --pull β€” syncs changes from wherever this branch was originally copied from
  • --setup β€” sets up a project for the DEPOTPATH you specify
  • --from BRANCH β€” names the source branch
  • --from-tag TAG β€” names the source tag
  • -C [--check-only] β€” tries a create, move or merge operation but literally changes nothing (a lil dress rehearsal πŸ™ˆ)
  • -P [--patch] FILE β€” writes the patch between the branch and where it was copied from out to FILE
  • --export β€” used alongside --checkout to make a detached copy
  • --offline β€” takes the current branch offline, making a copy under //local
  • --online β€” takes the current branch online, pushing changes back to the mirror path, and then switches over to the mirror

πŸ’œ DESCRIPTION πŸ’œ

SVK gives you the tools to manage your project's branching and merging way more easily β€” as long as you stick to the standard "trunk/, branches/, tags/" directory layout for your project, or you specifically tell SVK where your branches live. You got this fr fr. 🌈

πŸ¦‹ Usage (without projects)

A very simple sample usage would be checking out the trunk from a project you wanna work on but don't have upstream commit rights for. That way you can keep a local branch and send in patches. 🫢

Say you've alread mirrored this repository to //mirror/Project:

svk co //mirror/Project/trunk

or

svk branch --co trunk //mirror/Project/

and then

svk branch --offline

You're now working in a local branch! Make local commits and changes as much as you need. If you want to bring in changes from your remote repository, you can pull them down:

svk branch --pull

To see what changes you've made, you can create a patch between the local branch and the remote repository:

svk branch -P - --push

If you have commit rights to the remote repository, you can also

svk branch --push

to send your changes. πŸ’Œ

You can use svk branch's branching capability in this mode, but honestly? It'll be way friendlier if you set up a project. ✨

🌸 Usage (projects)

To initialize a project in a repository, run the setup command:

svk branch --setup //mirror/Project

If you've got the standard trunk branches tags directories, svk will offer them as your starting point. And actually β€” if you have trunk branches and tags directories, svk will try to use them without neeting --setup, but then you won't be able to use the --project flag, and you'll need to use depotpaths in commands. πŸŽ€

The rest of this documentation assumes you've set up a project called Example in //mirror/Project.

If you're in a working copy of svk where it can work out the Project name, you can leave off the --project flag from the examples below β€” but you can branch/tag/merge without having working copies at all. πŸ’…

πŸ‘‘ Branching

To check out the trunk, you can run:

svk branch --co trunk --project Example

To create a branch for release engineering:

svk branch --create Exmaple-1.0-releng --project Example

Since you've already got a checkout of trunk, you can convert that one:

cd trunk
svk branch --switch-to Example-1.0-releng

Or you can get a clean checkout:

svk branch --co Example-1.0-releng --project Example

If changes are made on trunk and you wanna bring them down to the release engineering branch, you can do that with the branch merge command:

svk branch --merge trunk Example-1.0-releng

If you're cautious, use the check flags first:

svk branch -C --merge trunk Example-1.0-releng
svk branch -P -  --merge trunk Example-1.0-releng

These will show you what svk wants to do. πŸ‘€

Let's say you want to add a feature to trunk but work on a branch so you don't inconvenience the other people working on trunk:

svk branch --create Feature --project Example

work on your feature, svk ci some changes:

svk branch --merge Feature trunk --project Example

continue to bring down changes several ways:

svk branch --pull
svk branch --merge trunk Feature
svk branch --merge trunk .   (if you're in a working copy of the branch)

and then merge back more feature work as you need to.

To get rid of a branch when you're done with it:

svk branch --delete Feature --project Example

To see all of your branches, you can do:

svk branch --list --project Example

πŸŽ€ Tagging

If you've been working on your releng branch and you're ready to cut a release, you can easily create a tag:

svk branch --tag --create 1.0rc1 --from Example-1.0-releng --project Example

If you'd like to check out this tag, use:

svk branch --tag --co 1.0rc1 --project Example

⭐ Project Property Details ⭐

SVK branch also gives you another project loading mechanism: setting properties on the root path. The current usable properties for SVK branch are:

'svk:project:<projectName>:path-trunk'
'svk:project:<projectName>:path-branches'
'svk:project:<projectName>:path-tags'

These properties are useful when you're not using the standard "trunk/, branches/, tags/" directory layout. For example, a mirrored depotpath '//mirror/projA' may have trunk in the "/trunk/projA/" directory, branches in "/branches/projA", and have a standard "/tags" directory. Then by setting the following properties on the root path of the remote repository, it can use SVK branch to help manage the project:

'svk:project:projA:path-trunk => /trunk/projA'
'svk:project:projA:path-branches => /branches/projA'
'svk:project:projA:path-tags => /tags'
Be sure to have all "path-trunk", "path-branches" and "path-tags" set at the same time. Not optional, bestie, all three or it's giving chaos. πŸ’€

and that's the whole page, you ate that 🫢 This one ships as part of perl v5.42.0, dated 2025-07-25, from the SVK::Co...:Branch(3) manual. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from