debian/0000755000000000000000000000000012200243534007161 5ustar debian/gbp.conf0000644000000000000000000000003612200243534010577 0ustar [DEFAULT] pristine-tar = True debian/control0000644000000000000000000000173112200243534010566 0ustar Source: hg-fast-export Section: vcs Priority: optional Maintainer: Andrey Rahmatullin Build-Depends: debhelper (>= 8), python (>= 2.6.6-3) Standards-Version: 3.9.4 Homepage: http://repo.or.cz/w/fast-export.git Vcs-Git: git://anonscm.debian.org/collab-maint/hg-fast-export.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/hg-fast-export.git;a=summary Package: hg-fast-export Architecture: all Depends: ${python:Depends}, ${misc:Depends}, git, mercurial Description: mercurial to git converter using git-fast-import hg-fast-export tool allows incremental import of mercurial repositories to git repositories. . It can automatically import a local hg repo into a local git repo using just one command. Subsequent importing of new changesets is supported. . Included git-hg wrapper script can be used to transparently track Mercurial repositories without a separate checkout. It also includes experimental support for pushing back to Mercurial. debian/git-hg.10000644000000000000000000000140412200243534010421 0ustar .TH GIT-HG "1" "February 2012" "git-hg" "User Commands" .SH NAME git\-hg \- tool for tracking Hg repos in Git .SH DESCRIPTION git\-hg can be used to transparently track Mercurial repositories in Git ones. .SH USAGE .SS "To clone a mercurial repo run:" .IP clone [local_checkout_path] .SS "If that fails (due to unnamed heads) try:" .IP clone \-\-force [local_checkout_path] .SS "To work with a cloned mercurial repo use:" .TP \fBfetch [ \-\-force ]\fR fetch latest branches from mercurial .TP \fBpull [ \-\-force ] [\-\-rebase]\fR fetch and merge (or rebase) the into the current branch .TP \fBpush [destination]\fR push latest changes to mercurial .TP \fBcheckout [ \-\-force ] branch_name\fR checkout a mercurial branch debian/docs0000644000000000000000000000005012200243534010027 0ustar hg-fast-export.txt debian/README.git-hg debian/hg-reset.10000644000000000000000000000105612200243534010763 0ustar .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. .TH HG-RESET "1" "February 2011" "hg-reset" "User Commands" .SH NAME hg-reset \- print info for hg-fast-export restart .SH SYNOPSIS .B hg-reset [\fI-r \fR] \fI-R \fR .SH DESCRIPTION Print SHA1s of latest changes per branch up to useful to reset import and restart at . If is omitted, use last hg repository as obtained from state file, GIT_DIR/hg2git\-state by default. .SH OPTIONS .TP \fB\-R\fR Hg revision to reset to .TP \fB\-r\fR Mercurial repository to use debian/changelog0000644000000000000000000000334012200243534011033 0ustar hg-fast-export (20120921-1) unstable; urgency=low * Upload to unstable * Use canonical URLs in Vcs-* control fields -- Andrey Rahmatullin Tue, 06 Aug 2013 23:43:31 +0600 hg-fast-export (20120921-1~exp1) experimental; urgency=low * Upload to experimental * New upstream snapshot, fixing compatibility with Mercurial 2.3 * Update git-hg from https://github.com/cosmin/git-hg/tree/c1fabd7b9ae5f557e61206aec9774019cf670f4a (Closes: #678518) * Bump Standards-Version: to 3.9.4 (no change needed) -- Andrey Rahmatullin Fri, 21 Sep 2012 22:07:06 +0600 hg-fast-export (20120618-1) unstable; urgency=low * New upstream snapshot * Update git-hg from https://github.com/cosmin/git-hg/tree/96cb6a7b and update debian/git-hg.1 * Update debian/hg-fast-export.1 * Bump Standards-Version: to 3.9.3 (no change needed) -- Andrey Rahmatullin Mon, 18 Jun 2012 15:09:29 +0600 hg-fast-export (20120203-1) unstable; urgency=low [ Barak A. Pearlmutter ] * Use debian/hg-fast-export.install instead of commands in debian/rules [ Andrey Rahmatullin ] * New upstream snapshot (Closes: #652724) * Update git-hg and README.git-hg from https://github.com/offbytwo/git-hg/tree/b3d5dc0dd3 and update debian/git-hg.1 (Closes: #655247) * Update debian/copyright -- Andrey Rahmatullin Sat, 04 Feb 2012 00:10:55 +0600 hg-fast-export (20110318-2) unstable; urgency=low * Add git-hg wrapper script (Closes: #622172) -- Andrey Rahmatullin Wed, 20 Apr 2011 21:16:35 +0600 hg-fast-export (20110318-1) unstable; urgency=low * Initial release (Closes: #574914) -- Andrey Rahmatullin Sun, 10 Apr 2011 22:52:33 +0600 debian/source/0000755000000000000000000000000012200243534010461 5ustar debian/source/format0000644000000000000000000000001412200243534011667 0ustar 3.0 (quilt) debian/hg-fast-export.manpages0000644000000000000000000000007212200243534013545 0ustar debian/hg-fast-export.1 debian/hg-reset.1 debian/git-hg.1 debian/git-hg0000755000000000000000000001321512200243534010270 0ustar #!/usr/bin/env bash if which python2 >&/dev/null; then PYTHON=python2 export PYTHON fi set -e # Try to use GNU Coreutils readlink --canonicalize if available, # falling back to less robust shell script only if not found. if which greadlink >&/dev/null; then canon="greadlink --canonicalize" elif readlink --canonicalize / >&/dev/null; then canon="readlink --canonicalize" else canon=canonicalize fi function canonicalize { path="$1" while [[ -L "$path" ]]; do dir=$(dirname "$path") path=$(ls -l "$path" | sed -e 's/.* -> //') cd "$dir" done dir=$(dirname "$path") file=$(basename "$path") if [[ ! -d "$dir" ]]; then echo "canonize: $dir: No such directory" >&2 exit 1 fi cdir=$(cd "$dir" && pwd -P) printf "%s/%s\n" "$cdir" "$file" } function get-gitdir { if [ -n "${GIT_DIR}" ]; then echo "error: environment variable GIT_DIR must not be set" exit 1 fi GITDIR="$(git rev-parse --git-dir)" } function git-current-branch { local ref ref=$(git symbolic-ref -q HEAD) && echo "${ref#refs/heads/}" } function check-hg-fast-export { # Search for hg-fast-export $PATH, use if available, if not fall back # to looking around for it in sibling directory of bin directory of # the current exeuctable, possibly tracing back along symbolic link. if type hg-fast-export > /dev/null 2>&1 ; then HG_FAST_EXPORT=hg-fast-export else GITHG_HOME=$($canon "$(dirname "$($canon "$0")")/..") HG_FAST_EXPORT=$GITHG_HOME/fast-export/hg-fast-export.sh if ! type "$HG_FAST_EXPORT" > /dev/null 2>&1 ; then echo "error: executable not found, $HG_FAST_EXPORT" echo 'Possible fixes: run "git submodule update --init" in git-hg repo, or' echo 'install hg-fast-export executable in directory on $PATH.' exit 1 fi fi } function git-hg-clone { check-hg-fast-export if [[ $1 == "--force" ]]; then FORCE="--force" shift fi HG_REMOTE=$1 if [[ $# -lt 2 ]]; then CHECKOUT=$(basename "${1%#*}") else CHECKOUT=$2 fi if [[ -a $CHECKOUT ]]; then echo "error: $CHECKOUT exists" exit 1 fi git init "$CHECKOUT" ( cd "$CHECKOUT" get-gitdir hg clone -U "$HG_REMOTE" "${GITDIR}/hgcheckout" git init --bare ${GITDIR}/hgremote ( cd ${GITDIR}/hgremote "$HG_FAST_EXPORT" -r ../hgcheckout $FORCE ) git remote add hg ${GITDIR}/hgremote git fetch hg if git rev-parse --verify -q remotes/hg/master > /dev/null; then local branch="master" else local branch=$(cd ${GITDIR}/hgcheckout/ && hg tip | grep branch | awk '{print $2}') fi git config hg.tracking.master "$branch" git pull hg "$branch" ) } function git-hg-fetch { check-hg-fast-export if [[ $1 == "--force" ]]; then FORCE="--force" shift fi get-gitdir hg -R ${GITDIR}/hgcheckout pull ( cd ${GITDIR}/hgremote "$HG_FAST_EXPORT" $FORCE ) git fetch hg } function git-hg-pull { while [[ $# -gt 0 ]]; do case "$1" in --rebase) REBASE="--rebase" ;; --force) FORCE="--force" ;; esac shift done git-hg-fetch $FORCE local current_branch remote_branch if ! current_branch=$(git-current-branch); then echo "ERROR: You are not currently on a branch." exit 1 fi if [[ $current_branch == "master" ]]; then remote_branch=$(git config hg.tracking.master || true) if [[ -z $remote_branch ]]; then if git rev-parse --verify -q remotes/hg/master > /dev/null; then remote_branch="master" git config hg.tracking.master master else echo "ERROR: Cannot determine remote branch. There is no remote branch called master, and hg.tracking.master not set. Merge the desired branch manually." exit 1 fi fi else remote_branch=$(git config "hg.tracking.$current_branch" || true) if [[ -z $remote_branch ]]; then echo "ERROR: Cannot determine the remote branch to pull from. Run git merge manually against the desired remote branch." echo "Alternatively, set hg.tracking.$current_branch to the name of the branch in hg the current branch should track" exit 1 fi fi if [[ "$REBASE" == "--rebase" ]]; then git rebase "hg/$remote_branch" else git merge "hg/$remote_branch" fi } function git-hg-checkout { if [[ $1 == "--force" ]]; then FORCE="--force" shift fi git-hg-fetch $FORCE git checkout "hg/$1" -b "$1" } function git-hg-push { HG_REPO=$1 get-gitdir hg --config extensions.convert= convert . ${GITDIR}/hgcheckout hg -R ${GITDIR}/hgcheckout push "$HG_REPO" } function usage { echo "To clone a mercurial repo run:" echo " clone [local_checkout_path]" echo "" echo " if that fails (due to unnamed heads) try:" echo " git-hg clone --force [local_checkout_path]" echo "" echo "To work with a cloned mercurial repo use: " echo " fetch [ --force ] fetch latest branches from mercurial" echo " pull [ --force ] [ --rebase ] fetch and merge (or rebase) into the" echo " current branch" echo " push [destination] push latest changes to mercurial" echo " checkout [ --force ] branch_name checkout a mercurial branch" } FORCE= REBASE= CMD=$1 shift case "$CMD" in clone|fetch|pull|checkout|push) git-hg-$CMD "$@" ;; *) usage exit 1 ;; esac debian/hg-fast-export.10000644000000000000000000000213212200243534012111 0ustar .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. .TH HG-FAST-EXPORT "1" "February 2011" "hg-fast-export" "User Commands" .SH NAME hg-fast-export \- import hg repository into git .SH SYNOPSIS .B hg-fast-export [\fI--quiet\fR] [\fI-r \fR] [\fI--force\fR] [\fI-m \fR] [\fI-s\fR] [\fI-A \fR] [\fI-M \fR] [\fI-o \fR] .SH DESCRIPTION Import hg repository up to either tip or If is omitted, use last hg repository as obtained from state file, GIT_DIR/hg2git\-state by default. .PP Note: The argument order matters. .SH OPTIONS .TP \fB\-m\fR Maximum revision to import .HP \fB\-\-quiet\fR Passed to git\-fast\-import(1) .TP \fB\-s\fR Enable parsing Signed\-off\-by lines .TP \fB\-A\fR Read author map from file (Same as in git\-svnimport(1) and git\-cvsimport(1)) .TP \fB\-r\fR Mercurial repository to import .TP \fB\-M\fR Set the default branch name (default to 'master') .TP \fB\-o\fR Use as branch namespace to track upstream (eg 'origin') .TP \fB\-\-force\fR Ignore validation errors when converting, and pass \-\-force to git\-fast\-import(1) debian/copyright0000644000000000000000000000503112200243534011113 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: fast-export Source: http://repo.or.cz/w/fast-export.git Files: hg* Copyright: 2007, 2008 Rocco Rutte and others. License: MIT Files: svn* Makefile Copyright: 2007 Chris Lee License: MIT Files: hg-reset.py Copyright: 2007, 2008 Rocco Rutte and others. License: GPL-2 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". Files: debian/* Copyright: 2011-2012 Andrey Rahmatullin 2011 Barak A. Pearlmutter License: MIT Files: debian/git-hg debian/README.git-hg Copyright: 2009-2012 Cosmin Stejerean 2010 Dave Abrahams 2011 Barak A. Pearlmutter 2011 Edmund Kohlwey License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/README.git-hg0000644000000000000000000000316112200243534011220 0ustar # git-hg # *Description*: A set of scripts for checking out and tracking a mercurial project from git. Push supported added as well although it is still experimental. *Author*: Cosmin Stejerean (offbytwo) *License*: MIT ## Dependencies ## Mercurial (`hg`) and python must be installed and in your `$PATH`. If this is a fresh checkout run $ git submodule update --init to pull in fast-export. If for some reason you cannot do this get a copy of fast-export from http://repo.or.cz/w/fast-export.git and place it in the root of the checkout. ## Installation ## Either add `/path/to/this/checkout/bin` to your `$PATH`, or symbolic link `/path/to/this/checkout/bin/git-hg` into a directory on your `$PATH`. Alternatively you can execute $ make $ sudo make install to install the script and all required fast-export files in `/usr/local` (you can change the destination by passing eg `PREFIX=/usr` to make install) ## Usage ## - Clone an hg repo, including ones over HTTP: $ git-hg clone http://some/random/hg/repo [local-git-repo-name] - Fetch updates from the hg repo: $ git-hg fetch or optionally: $ git-hg pull # same as git-hg-fetch && git merge hg/branch_name - Checkout a new branch from hg: $ git-hg checkout branch_name - Push changes back to hg, optionally to a specific destination: $ git-hg push [destination] ## Structure ## `.git/hgcheckout` - contains a bare mercurial checkout of the specified repo `.git/hgremote` - contains a bare git repo clones from the mercurial one, this is added as a remote called "hg" in the base repo debian/patches/0000755000000000000000000000000012200243534010610 5ustar debian/patches/fix-installation-path.patch0000644000000000000000000000160612200243534016053 0ustar Description: Use scripts installed to /usr/share instead of /usr/bin Author: Andrey Rahmatullin Forwarded: not-needed Last-Update: 2011-02-23 diff --git a/hg-fast-export.sh b/hg-fast-export.sh index a2ef9ea..5211ffe 100755 --- a/hg-fast-export.sh +++ b/hg-fast-export.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007, 2008 Rocco Rutte and others. # License: MIT -ROOT="`dirname $0`" +ROOT="/usr/share/hg-fast-export" REPO="" PFX="hg2git" SFX_MAPPING="mapping" diff --git a/hg-reset.sh b/hg-reset.sh index c77c291..868d06f 100755 --- a/hg-reset.sh +++ b/hg-reset.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007, 2008 Rocco Rutte and others. # License: MIT -ROOT="`dirname $0`" +ROOT="/usr/share/hg-fast-export" REPO="" PFX="hg2git" SFX_MARKS="marks" debian/patches/series0000644000000000000000000000003412200243534012022 0ustar fix-installation-path.patch debian/rules0000755000000000000000000000065612200243534010250 0ustar #!/usr/bin/make -f dh_targets=binary binary-arch binary-indep build build-arch build-indep clean install .PHONY: $(dh_targets) $(dh_targets) %: dh $@ --with python2 .PHONY: override_dh_auto_build override_dh_auto_install override_dh_auto_build: override_dh_auto_install: install -D -m 0755 hg-fast-export.sh debian/hg-fast-export/usr/bin/hg-fast-export install -D -m 0755 hg-reset.sh debian/hg-fast-export/usr/bin/hg-reset debian/hg-fast-export.install0000644000000000000000000000013312200243534013416 0ustar hg-fast-export.py hg-reset.py hg2git.py /usr/share/hg-fast-export/ debian/git-hg /usr/bin/ debian/compat0000644000000000000000000000000212200243534010357 0ustar 8