Merge branch 'jx/i18n'
authorJunio C Hamano <gitster@pobox.com>
Mon, 21 Apr 2014 17:42:52 +0000 (10:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Apr 2014 17:42:52 +0000 (10:42 -0700)
* jx/i18n:
i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines
i18n: only extract comments marked with "TRANSLATORS:"
i18n: remove obsolete comments for translators in diffstat generation
i18n: fix uncatchable comments for translators in date.c

29 files changed:
Documentation/RelNotes/2.0.0.txt
Documentation/howto-index.sh
Documentation/install-webdoc.sh
GIT-VERSION-GEN
config.c
contrib/completion/git-completion.bash
contrib/completion/git-completion.zsh
contrib/completion/git-prompt.sh
contrib/examples/git-checkout.sh
contrib/examples/git-clone.sh
contrib/examples/git-commit.sh
contrib/examples/git-fetch.sh
contrib/examples/git-ls-remote.sh
contrib/examples/git-merge.sh
contrib/examples/git-repack.sh
contrib/examples/git-resolve.sh
contrib/examples/git-revert.sh
contrib/examples/git-tag.sh
contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
contrib/remote-helpers/git-remote-bzr
contrib/remote-helpers/git-remote-hg
contrib/remote-helpers/test-bzr.sh
contrib/remote-helpers/test-hg-bidi.sh
contrib/remote-helpers/test-hg-hg-git.sh
git-rebase--am.sh
git-rebase--interactive.sh
git-rebase--merge.sh
git-rebase.sh
index 46ae447dfdaa769067699eafd266acdf955e0dbe..e3102524529ab54247a7a2ec56f4dbd42f4c9d51 100644 (file)
@@ -174,6 +174,11 @@ Unless otherwise noted, all the fixes since v1.9 in the maintenance
 track are contained in this release (see the maintenance releases'
 notes for details).
 
+ * zsh prompt (in contrib/) leaked unnecessary error messages.
+
+ * bash completion (in contrib/) did not complete the refs and remotes
+   correctly given "git pu<TAB>" when "pu" is aliased to "push".
+
  * Some more Unicode codepoints defined in Unicode 6.3 as having zero
    width have been taught to our display column counting logic.
    (merge d813ab9 tb/unicode-6.3-zero-width later to maint).
index a2340864b534b4eaa7c8f9a6197563b8d939c544..167b363668b8b53d752d5971798d3ca26c8f7f1f 100755 (executable)
@@ -11,8 +11,8 @@ EOF
 
 for txt
 do
-       title=`expr "$txt" : '.*/\(.*\)\.txt$'`
-       from=`sed -ne '
+       title=$(expr "$txt" : '.*/\(.*\)\.txt$')
+       from=$(sed -ne '
        /^$/q
        /^From:[        ]/{
                s///
@@ -21,9 +21,9 @@ do
                s/^/by /
                p
        }
-       ' "$txt"`
+       ' "$txt")
 
-       abstract=`sed -ne '
+       abstract=$(sed -ne '
        /^Abstract:[    ]/{
                s/^[^   ]*//
                x
@@ -39,11 +39,11 @@ do
                x
                p
                q
-       }' "$txt"`
+       }' "$txt")
 
        if grep 'Content-type: text/asciidoc' >/dev/null $txt
        then
-               file=`expr "$txt" : '\(.*\)\.txt$'`.html
+               file=$(expr "$txt" : '\(.*\)\.txt$').html
        else
                file="$txt"
        fi
index 76d69a907b48a961906e0b85c59a75e9c0c8986d..ed8b4ff3e5874eac2f8ffe3486abe9d9668b27ce 100755 (executable)
@@ -18,17 +18,17 @@ do
        else
                echo >&2 "# install $h $T/$h"
                rm -f "$T/$h"
-               mkdir -p `dirname "$T/$h"`
+               mkdir -p $(dirname "$T/$h")
                cp "$h" "$T/$h"
        fi
 done
-strip_leading=`echo "$T/" | sed -e 's|.|.|g'`
+strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
 for th in \
        "$T"/*.html "$T"/*.txt \
        "$T"/howto/*.txt "$T"/howto/*.html \
        "$T"/technical/*.txt "$T"/technical/*.html
 do
-       h=`expr "$th" : "$strip_leading"'\(.*\)'`
+       h=$(expr "$th" : "$strip_leading"'\(.*\)')
        case "$h" in
        RelNotes-*.txt | index.html) continue ;;
        esac
index a651d68656617182ef79e9bad5d539d74346b83c..5b367ab7feab2822b972b0051e205eeb940e0519 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.9.0.GIT
+DEF_VER=v2.0.0-rc0
 
 LF='
 '
index 6821cef00a0da56fbdadbd34d179ba5bd125c3a6..a30cb5c07db18a5ac16c1c98b6600c9fe6dc1b73 100644 (file)
--- a/config.c
+++ b/config.c
@@ -557,6 +557,7 @@ int git_parse_ulong(const char *value, unsigned long *ret)
        return 1;
 }
 
+NORETURN
 static void die_bad_number(const char *name, const char *value)
 {
        const char *reason = errno == ERANGE ?
index 87de809d23146c2cee818555028cf8a24dc6c908..2c59a76bc2cf2d0fefb633efe805b6c7c15ad7ec 100644 (file)
@@ -2564,6 +2564,7 @@ __git_main ()
 
        local expansion=$(__git_aliased_command "$command")
        if [ -n "$expansion" ]; then
+               words[1]=$expansion
                completion_func="_git_${expansion//-/_}"
                declare -f $completion_func >/dev/null && $completion_func
        fi
index 6b779685722916f8032dce9b3b46220eb6a19414..9f6f0fa5581002a2371e062fd5def0978733edc1 100644 (file)
@@ -104,6 +104,7 @@ __git_zsh_bash_func ()
 
        local expansion=$(__git_aliased_command "$command")
        if [ -n "$expansion" ]; then
+               words[1]=$expansion
                completion_func="_git_${expansion//-/_}"
                declare -f $completion_func >/dev/null && $completion_func
        fi
index 7b732d2aeba0e3bca3b42d28f2f8f5730a08ccee..54489080f8ae25a4483cd4bae076942f47f53031 100644 (file)
@@ -259,6 +259,13 @@ __git_ps1_colorize_gitstring ()
        r="$c_clear$r"
 }
 
+eread ()
+{
+       f="$1"
+       shift
+       test -r "$f" && read "$@" <"$f"
+}
+
 # __git_ps1 accepts 0 or 1 arguments (i.e., format string)
 # when called from PS1 using command substitution
 # in this mode it prints text to add to bash PS1 prompt (includes branch name)
@@ -321,9 +328,9 @@ __git_ps1 ()
        local step=""
        local total=""
        if [ -d "$g/rebase-merge" ]; then
-               read b 2>/dev/null <"$g/rebase-merge/head-name"
-               read step 2>/dev/null <"$g/rebase-merge/msgnum"
-               read total 2>/dev/null <"$g/rebase-merge/end"
+               eread "$g/rebase-merge/head-name" b
+               eread "$g/rebase-merge/msgnum" step
+               eread "$g/rebase-merge/end" total
                if [ -f "$g/rebase-merge/interactive" ]; then
                        r="|REBASE-i"
                else
@@ -331,10 +338,10 @@ __git_ps1 ()
                fi
        else
                if [ -d "$g/rebase-apply" ]; then
-                       read step 2>/dev/null <"$g/rebase-apply/next"
-                       read total 2>/dev/null <"$g/rebase-apply/last"
+                       eread "$g/rebase-apply/next" step
+                       eread "$g/rebase-apply/last" total
                        if [ -f "$g/rebase-apply/rebasing" ]; then
-                               read b 2>/dev/null <"$g/rebase-apply/head-name"
+                               eread "$g/rebase-apply/head-name" b
                                r="|REBASE"
                        elif [ -f "$g/rebase-apply/applying" ]; then
                                r="|AM"
@@ -358,7 +365,7 @@ __git_ps1 ()
                        b="$(git symbolic-ref HEAD 2>/dev/null)"
                else
                        local head=""
-                       if ! read head 2>/dev/null <"$g/HEAD"; then
+                       if ! eread "$g/HEAD" head; then
                                if [ $pcmode = yes ]; then
                                        PS1="$ps1pc_start$ps1pc_end"
                                fi
index d2c1f98b8628e2b807bc49ff310097686f3da6e6..683cae7c3fad09bec012351b530b7e909d70890f 100755 (executable)
@@ -222,7 +222,7 @@ else
 
        # Match the index to the working tree, and do a three-way.
        git diff-files --name-only | git update-index --remove --stdin &&
-       work=`git write-tree` &&
+       work=$(git write-tree) &&
        git read-tree $v --reset -u $new || exit
 
        eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
@@ -233,7 +233,7 @@ else
        # Do not register the cleanly merged paths in the index yet.
        # this is not a real merge before committing, but just carrying
        # the working tree changes along.
-       unmerged=`git ls-files -u`
+       unmerged=$(git ls-files -u)
        git read-tree $v --reset $new
        case "$unmerged" in
        '')     ;;
@@ -269,7 +269,7 @@ if [ "$?" -eq 0 ]; then
        fi
        if test -n "$branch"
        then
-               old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+               old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
                GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from ${old_branch_name:-$old} to $branch" HEAD "refs/heads/$branch"
                if test -n "$quiet"
                then
@@ -282,7 +282,7 @@ if [ "$?" -eq 0 ]; then
                fi
        elif test -n "$detached"
        then
-               old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+               old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
                git update-ref --no-deref -m "checkout: moving from ${old_branch_name:-$old} to $arg" HEAD "$detached" ||
                        die "Cannot detach HEAD"
                if test -n "$detach_warn"
index 547228e13ce60e575d0b4a10a322edfff6c0622c..b4c9376a2cf1611d777e3f995cae9f20e6616e4d 100755 (executable)
@@ -40,7 +40,7 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
 
 get_repo_base() {
        (
-               cd "`/bin/pwd`" &&
+               cd "$(/bin/pwd)" &&
                cd "$1" || cd "$1.git" &&
                {
                        cd .git
@@ -50,7 +50,7 @@ get_repo_base() {
 }
 
 if [ -n "$GIT_SSL_NO_VERIFY" -o \
-       "`git config --bool http.sslVerify`" = false ]; then
+       "$(git config --bool http.sslVerify)" = false ]; then
     curl_extra_args="-k"
 fi
 
@@ -70,7 +70,7 @@ clone_dumb_http () {
        clone_tmp="$GIT_DIR/clone-tmp" &&
        mkdir -p "$clone_tmp" || exit 1
        if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-               "`git config --bool http.noEPSV`" = true ]; then
+               "$(git config --bool http.noEPSV)" = true ]; then
                curl_extra_args="${curl_extra_args} --disable-epsv"
        fi
        http_fetch "$1/info/refs" "$clone_tmp/refs" ||
@@ -79,7 +79,7 @@ Perhaps git-update-server-info needs to be run there?"
        test "z$quiet" = z && v=-v || v=
        while read sha1 refname
        do
-               name=`expr "z$refname" : 'zrefs/\(.*\)'` &&
+               name=$(expr "z$refname" : 'zrefs/\(.*\)') &&
                case "$name" in
                *^*)    continue;;
                esac
@@ -88,7 +88,7 @@ Perhaps git-update-server-info needs to be run there?"
                *)      continue ;;
                esac
                if test -n "$use_separate_remote" &&
-                  branch_name=`expr "z$name" : 'zheads/\(.*\)'`
+                  branch_name=$(expr "z$name" : 'zheads/\(.*\)')
                then
                        tname="remotes/$origin/$branch_name"
                else
@@ -100,7 +100,7 @@ Perhaps git-update-server-info needs to be run there?"
        http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
        rm -f "$GIT_DIR/REMOTE_HEAD"
        if test -f "$GIT_DIR/REMOTE_HEAD"; then
-               head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
+               head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
                case "$head_sha1" in
                'ref: refs/'*)
                        ;;
@@ -444,15 +444,15 @@ then
        # a non-bare repository is always in separate-remote layout
        remote_top="refs/remotes/$origin"
        head_sha1=
-       test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
+       test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
        case "$head_sha1" in
        'ref: refs/'*)
                # Uh-oh, the remote told us (http transport done against
                # new style repository with a symref HEAD).
                # Ideally we should skip the guesswork but for now
                # opt for minimum change.
-               head_sha1=`expr "z$head_sha1" : 'zref: refs/heads/\(.*\)'`
-               head_sha1=`cat "$GIT_DIR/$remote_top/$head_sha1"`
+               head_sha1=$(expr "z$head_sha1" : 'zref: refs/heads/\(.*\)')
+               head_sha1=$(cat "$GIT_DIR/$remote_top/$head_sha1")
                ;;
        esac
 
@@ -467,7 +467,7 @@ then
                while read name
                do
                        test t = $done && continue
-                       branch_tip=`cat "$GIT_DIR/$remote_top/$name"`
+                       branch_tip=$(cat "$GIT_DIR/$remote_top/$name")
                        if test "$head_sha1" = "$branch_tip"
                        then
                                echo "$name"
index 4aab1a6d2161186227779ca5e793ed727c64d9db..5cafe2eb7715123ba0d748be308f35731ea89ddb 100755 (executable)
@@ -91,7 +91,7 @@ signoff=
 force_author=
 only_include_assumed=
 untracked_files=
-templatefile="`git config commit.template`"
+templatefile="$(git config commit.template)"
 while test $# != 0
 do
        case "$1" in
@@ -350,7 +350,7 @@ t,)
                TMP_INDEX="$GIT_DIR/tmp-index$$"
                W=
                test -z "$initial_commit" && W=--with-tree=HEAD
-               commit_only=`git ls-files --error-unmatch $W -- "$@"` || exit
+               commit_only=$(git ls-files --error-unmatch $W -- "$@") || exit
 
                # Build a temporary index and update the real index
                # the same way.
@@ -475,8 +475,8 @@ then
 fi
 if test '' != "$force_author"
 then
-       GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
-       GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
+       GIT_AUTHOR_NAME=$(expr "z$force_author" : 'z\(.*[^ ]\) *<.*') &&
+       GIT_AUTHOR_EMAIL=$(expr "z$force_author" : '.*\(<.*\)') &&
        test '' != "$GIT_AUTHOR_NAME" &&
        test '' != "$GIT_AUTHOR_EMAIL" ||
        die "malformed --author parameter"
@@ -489,7 +489,7 @@ then
        rloga='commit'
        if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
                rloga='commit (merge)'
-               PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
+               PARENTS="-p HEAD "$(sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD")
        elif test -n "$amend"; then
                rloga='commit (amend)'
                PARENTS=$(git cat-file commit HEAD |
index a314273bd51a865d9d5fc5cd899a51ffa70388a5..554070909cca4d229325a6ca6f401af8bc603cb2 100755 (executable)
@@ -67,7 +67,7 @@ do
                keep='-k -k'
                ;;
        --depth=*)
-               shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`"
+               shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')"
                ;;
        --depth)
                shift
@@ -262,12 +262,12 @@ fetch_per_ref () {
       http://* | https://* | ftp://*)
          test -n "$shallow_depth" &&
                die "shallow clone with http not supported"
-         proto=`expr "$remote" : '\([^:]*\):'`
+         proto=$(expr "$remote" : '\([^:]*\):')
          if [ -n "$GIT_SSL_NO_VERIFY" ]; then
              curl_extra_args="-k"
          fi
          if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-               "`git config --bool http.noEPSV`" = true ]; then
+               "$(git config --bool http.noEPSV)" = true ]; then
              noepsv_opt="--disable-epsv"
          fi
 
index fec70bbf88c614a2dadfc40950fdd7abdf7f2c63..2aa89a7df8ecd1ca8655fda650a4abd4a08a4cc6 100755 (executable)
@@ -55,11 +55,11 @@ tmpdir=$tmp-d
 case "$peek_repo" in
 http://* | https://* | ftp://* )
        if [ -n "$GIT_SSL_NO_VERIFY" -o \
-               "`git config --bool http.sslVerify`" = false ]; then
+               "$(git config --bool http.sslVerify)" = false ]; then
                curl_extra_args="-k"
        fi
        if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-               "`git config --bool http.noEPSV`" = true ]; then
+               "$(git config --bool http.noEPSV)" = true ]; then
                curl_extra_args="${curl_extra_args} --disable-epsv"
        fi
        curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
index a5e42a9f0124afcced9b639879f24916e0714e1c..7e40f40c78e2b040ae5b85adb27ebd4828f42b4d 100755 (executable)
@@ -341,7 +341,7 @@ case "$use_strategies" in
 '')
        case "$#" in
        1)
-               var="`git config --get pull.twohead`"
+               var="$(git config --get pull.twohead)"
                if test -n "$var"
                then
                        use_strategies="$var"
@@ -349,7 +349,7 @@ case "$use_strategies" in
                        use_strategies="$default_twohead_strategies"
                fi ;;
        *)
-               var="`git config --get pull.octopus`"
+               var="$(git config --get pull.octopus)"
                if test -n "$var"
                then
                        use_strategies="$var"
index 757933174e4c17136f14a1fdd7c8c67c0a8bca50..f312405a251ddc42f0483fb3d1ccc92d8a266fd1 100755 (executable)
@@ -49,7 +49,7 @@ do
        shift
 done
 
-case "`git config --bool repack.usedeltabaseoffset || echo true`" in
+case "$(git config --bool repack.usedeltabaseoffset || echo true)" in
 true)
        extra="$extra --delta-base-offset" ;;
 esac
index 8f98142f77b5d6eda44b301082da20604a893db0..48d0fc971f9e7ec3b4b15608950217ad71c5ba94 100755 (executable)
@@ -75,7 +75,7 @@ case "$common" in
                GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \
                        2>/dev/null || continue
                # Count the paths that are unmerged.
-               cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`
+               cnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l)
                if test $best_cnt -le 0 -o $cnt -le $best_cnt
                then
                        best=$c
index 6bf155cbdb61498bdaf84712a2dea6fb05361ce2..7e2aad549103c0c2cdaa452a60a16706f0c7e117 100755 (executable)
@@ -137,7 +137,7 @@ cherry-pick)
                q
        }'
 
-       logmsg=`git show -s --pretty=raw --encoding="$encoding" "$commit"`
+       logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
        set_author_env=`echo "$logmsg" |
        LANG=C LC_ALL=C sed -ne "$pick_author_script"`
        eval "$set_author_env"
index 2c15bc955b5bdf64119cdef87ad7519900cdd35f..1bd8f3c58d4508e5f7afc20619430d59b50582ff 100755 (executable)
@@ -156,7 +156,7 @@ prev=0000000000000000000000000000000000000000
 if git show-ref --verify --quiet -- "refs/tags/$name"
 then
     test -n "$force" || die "tag '$name' already exists"
-    prev=`git rev-parse "refs/tags/$name"`
+    prev=$(git rev-parse "refs/tags/$name")
 fi
 shift
 git check-ref-format "tags/$name" ||
index 811a90c9ae16cec2c99f01daa9d5e1254c9952d8..22f069db4896efcf0fd2a1a8912e72d9db3569ae 100755 (executable)
@@ -191,10 +191,10 @@ test_expect_success 'Git clone works with the shallow option' '
        test_path_is_file mw_dir_11/Main_Page.mw &&
        (
                cd mw_dir_11 &&
-               test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
-               test `git log --oneline Foo.mw | wc -l` -eq 1 &&
-               test `git log --oneline Bar.mw | wc -l` -eq 1 &&
-               test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+               test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Foo.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
        ) &&
        wiki_check_content mw_dir_11/Nyan.mw Nyan &&
        wiki_check_content mw_dir_11/Foo.mw Foo &&
@@ -218,9 +218,9 @@ test_expect_success 'Git clone works with the shallow option with a delete page'
        test_path_is_file mw_dir_12/Main_Page.mw &&
        (
                cd mw_dir_12 &&
-               test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
-               test `git log --oneline Bar.mw | wc -l` -eq 1 &&
-               test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+               test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
        ) &&
        wiki_check_content mw_dir_12/Nyan.mw Nyan &&
        wiki_check_content mw_dir_12/Bar.mw Bar &&
index 37021e200a32d36e37f5c0ca7f6cacdca7d80187..6b0dbdac4d355cb1a2c952977be2b3cf84aa17a7 100755 (executable)
@@ -70,8 +70,8 @@ test_expect_success 'The shallow option works with accents' '
        test_path_is_file mw_dir_4/Main_Page.mw &&
        (
                cd mw_dir_4 &&
-               test `git log --oneline Néoà.mw | wc -l` -eq 1 &&
-               test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+               test $(git log --oneline Néoà.mw | wc -l) -eq 1 &&
+               test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
        ) &&
        wiki_check_content mw_dir_4/Néoà.mw Néoà &&
        wiki_check_content mw_dir_4/Main_Page.mw Main_Page
index 5f4b2e3e160f60955e25f8b8fedf8c122dd5c73c..9abb58e6ab45077bf9b5e01658438817ea9b7126 100755 (executable)
@@ -618,10 +618,12 @@ def parse_commit(parser):
         files[path] = f
 
     committer, date, tz = committer
+    author, _, _ = author
     parents = [mark_to_rev(p) for p in parents]
     revid = bzrlib.generate_ids.gen_revision_id(committer, date)
     props = {}
     props['branch-nick'] = branch.nick
+    props['authors'] = author
 
     mtree = CustomTree(branch, revid, parents, files)
     changes = mtree.iter_changes()
@@ -784,7 +786,7 @@ def clone(path, remote_branch):
 def get_remote_branch(name):
     remote_branch = bzrlib.branch.Branch.open(branches[name],
                                               possible_transports=transports)
-    if isinstance(remote_branch.user_transport, bzrlib.transport.local.LocalTransport):
+    if isinstance(remote_branch.bzrdir.root_transport, bzrlib.transport.local.LocalTransport):
         return remote_branch
 
     branch_path = os.path.join(dirname, 'clone', name)
@@ -867,7 +869,7 @@ def get_repo(url, alias):
     if not wanted:
         try:
             repo = origin.open_repository()
-            if not repo.user_transport.listable():
+            if not repo.bzrdir.root_transport.listable():
                 # this repository is not usable for us
                 raise bzrlib.errors.NoRepositoryPresent(repo.bzrdir)
         except bzrlib.errors.NoRepositoryPresent:
index 36b526106ba7b3c61b70549770c1ec82f45e1baf..34cda027597f30ddacf340466778404f3705361d 100755 (executable)
@@ -260,6 +260,7 @@ class Parser:
         return (user, int(date), -tz)
 
 def fix_file_path(path):
+    path = os.path.normpath(path)
     if not os.path.isabs(path):
         return path
     return os.path.relpath(path, '/')
index 4f379c2ab499f2ca5556f844cbdcacb98fffa13c..a4656ce412cc8c192a636030a019c156bb58df7f 100755 (executable)
@@ -382,7 +382,7 @@ test_expect_success 'strip' '
 '
 
 test_expect_success 'export utf-8 authors' '
-       test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME" &&
+       test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && GIT_COMMITTER_NAME=\"C O Mitter\""
 
        LC_ALL=en_US.UTF-8
        export LC_ALL
@@ -411,4 +411,28 @@ test_expect_success 'export utf-8 authors' '
        test_cmp expected actual
 '
 
+test_expect_success 'push different author' '
+       test_when_finished "rm -rf bzrrepo gitrepo" &&
+
+       bzr init bzrrepo &&
+
+       (
+       git init gitrepo &&
+       cd gitrepo &&
+       echo john >> content &&
+       git add content &&
+       git commit -m john --author "John Doe <jdoe@example.com>" &&
+       git remote add bzr "bzr::../bzrrepo" &&
+       git push bzr master
+       ) &&
+
+       (
+       cd bzrrepo &&
+       bzr log | grep "^author: " > ../actual
+       ) &&
+
+       echo "author: John Doe <jdoe@example.com>" > expected &&
+       test_cmp expected actual
+'
+
 test_done
index e24c51daad1038184bd6113ceee77c042dc26f17..d86e147d3d400e226b1afb95fa2de48e42883fbd 100755 (executable)
@@ -8,7 +8,8 @@
 
 test_description='Test bidirectionality of remote-hg'
 
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then
index 6dcd95d10f618ee3ac4920f5f2ae684c0b8d4d36..b23909ae6ccc9cc5b2169c2898ea8de292bd0d22 100755 (executable)
@@ -8,7 +8,8 @@
 
 test_description='Test remote-hg output compared to hg-git'
 
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then
index df46f4ca9629253238e94ae31ae26c77b452dde3..ca20e1e66fbda7c27a8a4cfff03ecf02841e1002 100644 (file)
@@ -4,6 +4,17 @@
 # Copyright (c) 2010 Junio C Hamano.
 #
 
+# The whole contents of this file is run by dot-sourcing it from
+# inside a shell function.  It used to be that "return"s we see
+# below were not inside any function, and expected to return
+# to the function that dot-sourced us.
+#
+# However, FreeBSD /bin/sh misbehaves on such a construct and
+# continues to run the statements that follow such a "return".
+# As a work-around, we introduce an extra layer of a function
+# here, and immediately call it after defining it.
+git_rebase__am () {
+
 case "$action" in
 continue)
        git am --resolved --resolvemsg="$resolvemsg" \
@@ -75,3 +86,7 @@ then
 fi
 
 move_to_original_branch
+
+}
+# ... and then we call the whole thing.
+git_rebase__am
index 1c41cbd66c77641772c41898362b7fc550c4faca..6ec9d3cb40b1e96f75132a11eb625fd42e64885d 100644 (file)
@@ -820,6 +820,17 @@ add_exec_commands () {
        mv "$1.new" "$1"
 }
 
+# The whole contents of this file is run by dot-sourcing it from
+# inside a shell function.  It used to be that "return"s we see
+# below were not inside any function, and expected to return
+# to the function that dot-sourced us.
+#
+# However, FreeBSD /bin/sh misbehaves on such a construct and
+# continues to run the statements that follow such a "return".
+# As a work-around, we introduce an extra layer of a function
+# here, and immediately call it after defining it.
+git_rebase__interactive () {
+
 case "$action" in
 continue)
        # do we have anything to commit?
@@ -1055,3 +1066,7 @@ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name"
 output git checkout $onto || die_abort "could not detach HEAD"
 git update-ref ORIG_HEAD $orig_head
 do_rest
+
+}
+# ... and then we call the whole thing.
+git_rebase__interactive
index 5381857c59968c38526140d53e3150f19e8d0b0c..71429fd74373f3f804fc841b5dd60faca2baaec6 100644 (file)
@@ -101,6 +101,17 @@ finish_rb_merge () {
        say All done.
 }
 
+# The whole contents of this file is run by dot-sourcing it from
+# inside a shell function.  It used to be that "return"s we see
+# below were not inside any function, and expected to return
+# to the function that dot-sourced us.
+#
+# However, FreeBSD /bin/sh misbehaves on such a construct and
+# continues to run the statements that follow such a "return".
+# As a work-around, we introduce an extra layer of a function
+# here, and immediately call it after defining it.
+git_rebase__merge () {
+
 case "$action" in
 continue)
        read_state
@@ -151,3 +162,7 @@ do
 done
 
 finish_rb_merge
+
+}
+# ... and then we call the whole thing.
+git_rebase__merge
index 2c75e9fa0f8d4c10e6caa2b3f4d018a11bbf0f8f..4543815ffd6b0d49466edc3059f6d085b79ebf8a 100755 (executable)
@@ -175,22 +175,13 @@ You can run "git stash pop" or "git stash drop" at any time.
        rm -rf "$state_dir"
 }
 
-run_specific_rebase_internal () {
+run_specific_rebase () {
        if [ "$interactive_rebase" = implied ]; then
                GIT_EDITOR=:
                export GIT_EDITOR
                autosquash=
        fi
-       # On FreeBSD, the shell's "return" returns from the current
-       # function, not from the current file inclusion.
-       # run_specific_rebase_internal has the file inclusion as a
-       # last statement, so POSIX and FreeBSD's return will do the
-       # same thing.
        . git-rebase--$type
-}
-
-run_specific_rebase () {
-       run_specific_rebase_internal
        ret=$?
        if test $ret -eq 0
        then