Welcome to VersionControl_HG’s documentation!

VersionControl_HG is a library that provides an OO interface to handle Mercurial repositories.

Contents:

Add

Adds the specified files on the next commit.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$addCmd = Factory::createAdd();
$addCmd->execute();

Addremove

Adds all new files and delete all missing files.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$addremoveCmd = Factory::createAddremove();
$addremoveCmd->execute();

Annotate

Shows changeset information by line for each file.

Examples:

1
2
3
4
5
6
    use Siad007\VersionControl\HG\Factory;

    $annotateCmd = Factory::createAnnotate();
    $annotateCmd->addFile('C:\\xampp\\file1\\');
    $annotateCmd->addFile('C:\\xampp\\file2\\');
    $annotateCmd->setNoFollow(true);

Archive

Creates an unversioned archive of a repository revision.

Examples:

1
2
3
4
5
6
7
8
9
    use Siad007\VersionControl\HG\Factory;

    $archiveCmd = Factory::createArchive();
    $archiveCmd->setDestination('C:\\xampp\\dest\\');
    $archiveCmd->addInclude('includePattern');
    $archiveCmd->addExclude('excludePattern');
    $archiveCmd->setSubrepos(tru);
    $archiveCmd->setNoDecode(true);
    $archiveCmd->execute();

Backout

Reverses effect of earlier changeset.

Examples:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    use Siad007\VersionControl\HG\Factory;

    $backoutCmd = Factory::createBackout();
    $backoutCmd->setRevision('revision');
    $backoutCmd->setMerge(true);
    $backoutCmd->setTool('tool');
    $backoutCmd->addInclude('includePattern');
    $backoutCmd->addExclude('excludePattern');
    $backoutCmd->setMessage('text');
    $backoutCmd->setLogfile('logfile');
    $backoutCmd->setDate('date');
    $backoutCmd->setUser('user');

Bisect

Shows changeset information by line for each file.

Examples:

1
2
3
4
5
    use Siad007\VersionControl\HG\Factory;

    $bisecCmd = Factory::createBisec();
    $bisecCmd->setBad(true);
    $bisecCmd->setExtend(true);

Bookmarks

Tracks a line of development with movable markers.

Examples:

1
2
3
4
5
6
    use Siad007\VersionControl\HG\Factory;

    $bookmarksCmd = Factory::createBookmarks();
    $bookmarksCmd->addName('test');
    $bookmarksCmd->setRev('revision');
    $bookmarksCmd->setForce(true);

Branch

Sets or shows the current branch name.

Examples:

1
2
3
4
5
6
    use Siad007\VersionControl\HG\Factory;

    $branchCmd = Factory::createBranch();
    $branchCmd->setName('test');
    $branchCmd->setClean(true);
    $branchCmd->setForce(true);

Branches

Bundle

Creates a changegroup file

Examples:

1
2
3
4
5
6
7
8
9
    use Siad007\VersionControl\HG\Factory;

    $bundleCmd = Factory::createBundle();
    $bundleCmd->setFile('C:\\xampp\\file\\');
    $bundleCmd->setSsh('testSSH');
    $bundleCmd->setInsecure(true);
    $bundleCmd->setVerbose(true);
    $bundleCmd->setEncoding('UTF-8');
    $bundleCmd->execute();

Cat

Clone

Makes a copy of an existing repository.

Examples:

1
2
3
4
5
use Siad007\VersionControl\HG\Factory;

$cloneCmd = Factory::createClone();
$cloneCmd->setSource('/path/to/source');
$cloneCmd->execute();

Commit

Commitss the specified files and delete all missing files.

Examples:

1
2
3
4
5
6
7
use Siad007\VersionControl\HG\Factory;

$commitCmd = Factory::createCommit();
$commitCmd->setAddremove(true);
$commitCmd->setCloseBranch(true);
$commitCmd->setMessage('First commit.');
$commitCmd->setSubrepos(true);

Heads

Shows branch heads.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$headsCmd = Factory::createHeads();
$headsCmd->execute();

Init

Creates a new repository in the given directory.

Examples:

1
2
3
4
5
use Siad007\VersionControl\HG\Factory;

$initCmd = Factory::createInit();
$initCmd->setDestination('/path/to/destination');
$initCmd->execute();

Paths

Shows aliases for remote repositories.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$pathsCmd = Factory::createPaths();
$pathsCmd->execute();

Pull

Push

Root

Prints the root (top) of the current working directory.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$rootCmd = Factory::createRoot();
$rootCmd->execute();

Summary

Summarizes the working directory state.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$summaryCmd = Factory::createSummary();
$summaryCmd->execute();

Unbundle

Applies one or more changegroup files.

Examples:

1
2
3
4
5
6
7
    use Siad007\VersionControl\HG\Factory;

    $unbundleCmd = Factory::createUnbundle();
    $unbundleCmd->addFile('C:\\xampp\\file1\\');
    $unbundleCmd->addFile('C:\\xampp\\file2\\');
    $unbundleCmd->setUpdate(true);
    $unbundleCmd->execute();

Update

Updates working directory (or switches revisions)

Examples:

1
2
3
4
5
    use Siad007\VersionControl\HG\Factory;

    $updateCmd = Factory::createUpdate();
    $updateCmd->setClean(true);
    $updateCmd->execute();

Verify

Verifies the integrity of the repository.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$verifyCmd = Factory::createVerify();
$verifyCmd->execute();

Version

Outputs version and copyright informations.

Examples:

1
2
3
4
use Siad007\VersionControl\HG\Factory;

$versionCmd = Factory::createVersion();
$versionCmd->execute();

Commands