resvn

command module
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 13 Imported by: 0

README

resvn

Run SVN commands on multiple repositories

GoDoc Go Report Card

github.com/ardnew/resvn 0.10.0 darwin-amd64 main@573ee2a 2024-03-19T22:08:19Z

USAGE
  resvn [flags] [match ...] [! ignore ...] [-- command ...]

FLAGS (mnemonics shown in [brackets])
  -L path        use file path contents as [login] arguments
                 {"/Users/andrew/.svnauth"}
  -S url         use [server] url to construct REST API queries
                 {"http://localhost:3343"}
  -c             use [case]-sensitive matching
  -d             print commands which would be executed ([dry-run])
  -f path        use repository definitions from [file] path
                 {"/Users/andrew/.svnrepo"}
  -l user:pass   use user:pass to authenticate with SVN or REST API ([login])
  -o             use logical-[or] matching if multiple patterns given
  -q             suppress all non-essential and error messages ([quiet])
  -s url         use [server] url to construct all URLs
                 {"http://localhost:3690"}
  -u             [update] cached repository definitions from server
  -w             construct [web] URLs instead of repository URLs

NOTES
  The default server URL prefix is defined with environment variable $RESVN_URL
  and used when flag "-s" is unspecified. The default REST API URL prefix is
  defined with environment variable $RESVN_API and used when flag "-S" is
  unspecified. The REST API is optional because it is only used for automatic
  generation of the known SVN repository cache (otherwise given with flag "-f").
  URLs may include both protocol and port, e.g., "http://server.com:3690".

  All arguments following the first occurrence of "--" are forwarded (in the
  same order they were given) to each "svn" command generated. Since the same
  command may run with multiple repositories, placeholder variables may be used
  in the given command line, which are then substituted with attributes from the
  target repository each time the "svn" command is run.

      @ = repository URL (must be first character in word)
      ^ = repository base name
      & = preceding URL/path argument
      $ = last path component (basename) of "&"
      ! = parent path component (basename of dirname) of "&"

  For example, exporting a common tag from all repositories with "DAPA" in the
  name (excluding any that match "Calc" or "DIOS") into respectively-named
  subdirectories of the current directory:

      %% resvn DAPA ! Calc DIOS -- export @/tags/foo ./^/tags/foo

Usage

First, please read the command-line usage reference that is output with the help flag -h (also copied above).

Update repository cache

resvn operates primarily with a plain-text file, or cache, that defines all known repositories. The format of this file is simply one repository name per line. Each line should be the repository base name only (not a full URL). For example, a repository at URL http://rstok3-dev02:3690/svn/APS_Team would be represented by a single line containing only APS_Team. The full URL is generated by resvn using a combination of these repository names, the server URL prefix given with flag -s (or the default URL from environment variable $RESVN_URL), and the presence of flag -w.

Instead of creating and maintaining this cache manually, resvn is capable of requesting a list of all repositories from the SVN server and updating the cache automatically. When called with flag -u, and optionally flag -l if SVN credentials are not cached locally, the SVN server REST API is queried and results are written to a cache file in your current directory, overwriting any that already exists. You can copy this repository cache to your home directory, and it will be used as the default cache when calling resvn without flag -f.

Install

A few different options are available for installing. Version numbers being equal, there's no functional difference between them.

Download executable

Latest release

A zip package containing the executable and documentation is created for each of the most common OS/arch targets for every released version. Check out the releases page to see all versions available.

Compile from source code
# Clone the repository
git clone https://github.com/ardnew/resvn
cd resvn
# Compile executable
go build -v .
# Install somewhere in your $PATH
sudo cp resvn /usr/local/bin
Build and install using only Go toolchain
Current Go version 1.16 and later:
Latest release
go install -v github.com/ardnew/resvn@latest
Tip of a branch (active development is main)
go install -v github.com/ardnew/resvn@main
Unique tag
go install -v github.com/ardnew/resvn@v0.6.2
Legacy Go version 1.15 and earlier:
GO111MODULE=off go get -v github.com/ardnew/resvn

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL