Compare commits
9 Commits
v1.8.3-rc3
...
v1.8.3
Author | SHA1 | Date | |
---|---|---|---|
edca415256 | |||
5e49f30c85 | |||
92c4369907 | |||
737044517f | |||
9134a460e3 | |||
f4f4c7fc00 | |||
7d82b4af1c | |||
eff714bdda | |||
5dbe064d8c |
@ -42,8 +42,11 @@ Updates since v1.8.2
|
||||
Foreign interface
|
||||
|
||||
* remote-hg and remote-bzr helpers (in contrib/ since v1.8.2) have
|
||||
been updated; especially, the latter has been accelerated to help
|
||||
Emacs folks, whose primary SCM seems to be stagnating.
|
||||
been updated; especially, the latter has been done in an
|
||||
accelerated schedule (read: we may not have merged to this release
|
||||
if we were following the usual "cook sufficiently in next before
|
||||
unleashing it to the world" workflow) in order to help Emacs folks,
|
||||
whose primary SCM seems to be stagnating.
|
||||
|
||||
|
||||
UI, Workflows & Features
|
||||
@ -111,9 +114,10 @@ UI, Workflows & Features
|
||||
of erroneous inputs was suboptimal and has been improved.
|
||||
|
||||
* When the interactive access to git-shell is not enabled, it issues
|
||||
a message meant to help the system administrator to enable it.
|
||||
An explicit way to help the end users who connect to the service by
|
||||
issuing custom messages to refuse such an access has been added.
|
||||
a message meant to help the system administrator to enable it. An
|
||||
explicit way has been added to issue custom messages to refuse an
|
||||
access over the network to help the end users who connect to the
|
||||
service expecting an interactive shell.
|
||||
|
||||
* In addition to the case where the user edits the log message with
|
||||
the "e)dit" option of "am -i", replace the "Applying: this patch"
|
||||
@ -123,8 +127,8 @@ UI, Workflows & Features
|
||||
* "git status" suggests users to look into using --untracked=no option
|
||||
when it takes too long.
|
||||
|
||||
* "git status" shows a bit more information during a
|
||||
rebase/bisect session.
|
||||
* "git status" shows a bit more information during a rebase/bisect
|
||||
session.
|
||||
|
||||
* "git fetch" learned to fetch a commit at the tip of an unadvertised
|
||||
ref by specifying a raw object name from the command line when the
|
||||
@ -241,7 +245,6 @@ details).
|
||||
|
||||
* Various subcommands of "git remote" simply ignored extraneous
|
||||
command line arguments instead of diagnosing them as errors.
|
||||
(merge b17dd3f tr/remote-tighten-commandline-parsing later to maint).
|
||||
|
||||
* When receive-pack detects an error in the pack header it received in
|
||||
order to decide which of unpack-objects or index-pack to run, it
|
||||
@ -264,7 +267,6 @@ details).
|
||||
buffer around as human readable object names. This was not a huge
|
||||
problem but was exposed by a new change that uses these names in
|
||||
error output.
|
||||
(merge 70d26c6 tr/copy-revisions-from-stdin later to maint).
|
||||
|
||||
* Smart-capable HTTP servers were not restricted via the
|
||||
GIT_NAMESPACE mechanism when talking with commit-walking clients,
|
||||
@ -309,11 +311,9 @@ details).
|
||||
|
||||
* Fix a 1.8.1.x regression that stopped matching "dir" (without a
|
||||
trailing slash) to a directory "dir".
|
||||
(merge efa5f82 jc/directory-attrs-regression-fix later to maint-1.8.1).
|
||||
|
||||
* "git apply --whitespace=fix" was not prepared to see a line getting
|
||||
longer after fixing whitespaces (e.g. tab-in-indent aka Python).
|
||||
(merge 329b26e jc/apply-ws-fix-tab-in-indent later to maint-1.8.1).
|
||||
|
||||
* The prompt string generator (in contrib/completion/) did not notice
|
||||
when we are in a middle of a "git revert" session.
|
||||
|
@ -271,13 +271,15 @@ first have already been pushed into SVN.
|
||||
Create a tag by using the tags_subdir instead of the branches_subdir
|
||||
specified during git svn init.
|
||||
|
||||
-d;;
|
||||
--destination;;
|
||||
-d<path>;;
|
||||
--destination=<path>;;
|
||||
|
||||
If more than one --branches (or --tags) option was given to the 'init'
|
||||
or 'clone' command, you must provide the location of the branch (or
|
||||
tag) you wish to create in the SVN repository. The value of this
|
||||
option must match one of the paths specified by a --branches (or
|
||||
--tags) option. You can see these paths with the commands
|
||||
tag) you wish to create in the SVN repository. <path> specifies which
|
||||
path to use to create the branch or tag and should match the pattern
|
||||
on the left-hand side of one of the configured branches or tags
|
||||
refspecs. You can see these refspecs with the commands
|
||||
+
|
||||
git config --get-all svn-remote.<name>.branches
|
||||
git config --get-all svn-remote.<name>.tags
|
||||
@ -298,6 +300,11 @@ where <name> is the name of the SVN repository as specified by the -R option to
|
||||
git config --get-all svn-remote.<name>.commiturl
|
||||
+
|
||||
|
||||
--parents;;
|
||||
Create parent folders. This parameter is equivalent to the parameter
|
||||
--parents on svn cp commands and is useful for non-standard repository
|
||||
layouts.
|
||||
|
||||
'tag'::
|
||||
Create a tag in the SVN repository. This is a shorthand for
|
||||
'branch -t'.
|
||||
@ -1032,6 +1039,25 @@ comma-separated list of names within braces. For example:
|
||||
tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Multiple fetch, branches, and tags keys are supported:
|
||||
|
||||
------------------------------------------------------------------------
|
||||
[svn-remote "messy-repo"]
|
||||
url = http://server.org/svn
|
||||
fetch = trunk/project-a:refs/remotes/project-a/trunk
|
||||
fetch = branches/demos/june-project-a-demo:refs/remotes/project-a/demos/june-demo
|
||||
branches = branches/server/*:refs/remotes/project-a/branches/*
|
||||
branches = branches/demos/2011/*:refs/remotes/project-a/2011-demos/*
|
||||
tags = tags/server/*:refs/remotes/project-a/tags/*
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Creating a branch in such a configuration requires disambiguating which
|
||||
location to use using the -d or --destination flag:
|
||||
|
||||
------------------------------------------------------------------------
|
||||
$ git svn branch -d branches/server release-2-3-0
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Note that git-svn keeps track of the highest revision in which a branch
|
||||
or tag has appeared. If the subset of branches or tags is changed after
|
||||
fetching, then .git/svn/.metadata must be manually edited to remove (or
|
||||
|
@ -1831,7 +1831,7 @@ _git_config ()
|
||||
local remote="${prev#remote.}"
|
||||
remote="${remote%.fetch}"
|
||||
if [ -z "$cur" ]; then
|
||||
__gitcompadd "refs/heads/" "" "" ""
|
||||
__gitcomp_nl "refs/heads/" "" "" ""
|
||||
return
|
||||
fi
|
||||
__gitcomp_nl "$(__git_refs_remotes "$remote")"
|
||||
|
@ -24,9 +24,6 @@ import urllib
|
||||
import atexit
|
||||
import urlparse, hashlib
|
||||
|
||||
#
|
||||
# If you want to switch to hg-git compatibility mode:
|
||||
# git config --global remote-hg.hg-git-compat true
|
||||
#
|
||||
# If you are not in hg-git-compat mode and want to disable the tracking of
|
||||
# named branches:
|
||||
@ -36,7 +33,10 @@ import urlparse, hashlib
|
||||
# git config --global remote-hg.force-push false
|
||||
#
|
||||
# If you want the equivalent of hg's clone/pull--insecure option:
|
||||
# git config remote-hg.insecure true
|
||||
# git config --global remote-hg.insecure true
|
||||
#
|
||||
# If you want to switch to hg-git compatibility mode:
|
||||
# git config --global remote-hg.hg-git-compat true
|
||||
#
|
||||
# git:
|
||||
# Sensible defaults for git.
|
||||
@ -954,6 +954,10 @@ def main(args):
|
||||
marks_path = os.path.join(dirname, 'marks-hg')
|
||||
marks = Marks(marks_path)
|
||||
|
||||
if sys.platform == 'win32':
|
||||
import msvcrt
|
||||
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
||||
|
||||
parser = Parser(repo)
|
||||
for line in parser:
|
||||
if parser.check('capabilities'):
|
||||
|
19
git-svn.perl
19
git-svn.perl
@ -113,7 +113,7 @@ my ($_stdin, $_help, $_edit,
|
||||
$_template, $_shared,
|
||||
$_version, $_fetch_all, $_no_rebase, $_fetch_parent,
|
||||
$_before, $_after,
|
||||
$_merge, $_strategy, $_preserve_merges, $_dry_run, $_local,
|
||||
$_merge, $_strategy, $_preserve_merges, $_dry_run, $_parents, $_local,
|
||||
$_prefix, $_no_checkout, $_url, $_verbose,
|
||||
$_commit_url, $_tag, $_merge_info, $_interactive);
|
||||
|
||||
@ -203,6 +203,7 @@ my %cmd = (
|
||||
{ 'message|m=s' => \$_message,
|
||||
'destination|d=s' => \$_branch_dest,
|
||||
'dry-run|n' => \$_dry_run,
|
||||
'parents' => \$_parents,
|
||||
'tag|t' => \$_tag,
|
||||
'username=s' => \$Git::SVN::Prompt::_username,
|
||||
'commit-url=s' => \$_commit_url } ],
|
||||
@ -211,6 +212,7 @@ my %cmd = (
|
||||
{ 'message|m=s' => \$_message,
|
||||
'destination|d=s' => \$_branch_dest,
|
||||
'dry-run|n' => \$_dry_run,
|
||||
'parents' => \$_parents,
|
||||
'username=s' => \$Git::SVN::Prompt::_username,
|
||||
'commit-url=s' => \$_commit_url } ],
|
||||
'set-tree' => [ \&cmd_set_tree,
|
||||
@ -1172,6 +1174,10 @@ sub cmd_branch {
|
||||
$ctx->ls($dst, 'HEAD', 0);
|
||||
} and die "branch ${branch_name} already exists\n";
|
||||
|
||||
if ($_parents) {
|
||||
mk_parent_dirs($ctx, $dst);
|
||||
}
|
||||
|
||||
print "Copying ${src} at r${rev} to ${dst}...\n";
|
||||
$ctx->copy($src, $rev, $dst)
|
||||
unless $_dry_run;
|
||||
@ -1179,6 +1185,17 @@ sub cmd_branch {
|
||||
$gs->fetch_all;
|
||||
}
|
||||
|
||||
sub mk_parent_dirs {
|
||||
my ($ctx, $parent) = @_;
|
||||
$parent =~ s{/[^/]*$}{};
|
||||
|
||||
if (!eval{$ctx->ls($parent, 'HEAD', 0)}) {
|
||||
mk_parent_dirs($ctx, $parent);
|
||||
print "Creating parent folder ${parent} ...\n";
|
||||
$ctx->mkdir($parent) unless $_dry_run;
|
||||
}
|
||||
}
|
||||
|
||||
sub cmd_find_rev {
|
||||
my $revision_or_hash = shift or die "SVN or git revision required ",
|
||||
"as a command-line argument\n";
|
||||
|
48
t/t9167-git-svn-cmd-branch-subproject.sh
Executable file
48
t/t9167-git-svn-cmd-branch-subproject.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013 Tobias Schulte
|
||||
#
|
||||
|
||||
test_description='git svn branch for subproject clones'
|
||||
. ./lib-git-svn.sh
|
||||
|
||||
test_expect_success 'initialize svnrepo' '
|
||||
mkdir import &&
|
||||
(
|
||||
cd import &&
|
||||
mkdir -p trunk/project branches tags &&
|
||||
(
|
||||
cd trunk/project &&
|
||||
echo foo > foo
|
||||
) &&
|
||||
svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
|
||||
) &&
|
||||
rm -rf import &&
|
||||
svn_cmd co "$svnrepo"/trunk/project trunk/project &&
|
||||
(
|
||||
cd trunk/project &&
|
||||
echo bar >> foo &&
|
||||
svn_cmd ci -m "updated trunk"
|
||||
) &&
|
||||
rm -rf trunk
|
||||
'
|
||||
|
||||
test_expect_success 'import into git' '
|
||||
git svn init --trunk=trunk/project --branches=branches/*/project \
|
||||
--tags=tags/*/project "$svnrepo" &&
|
||||
git svn fetch &&
|
||||
git checkout remotes/trunk
|
||||
'
|
||||
|
||||
test_expect_success 'git svn branch tests' '
|
||||
test_must_fail git svn branch a &&
|
||||
git svn branch --parents a &&
|
||||
test_must_fail git svn branch -t tag1 &&
|
||||
git svn branch --parents -t tag1 &&
|
||||
test_must_fail git svn branch --tag tag2 &&
|
||||
git svn branch --parents --tag tag2 &&
|
||||
test_must_fail git svn tag tag3 &&
|
||||
git svn tag --parents tag3
|
||||
'
|
||||
|
||||
test_done
|
Reference in New Issue
Block a user