Skip to content

Commit

Permalink
Make sure that the cache file gets outputted where expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
dak180 committed Nov 14, 2015
1 parent 7930060 commit 167b750
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions autorevision.sh
Expand Up @@ -119,6 +119,8 @@ fi
# For git repos
# shellcheck disable=SC2155
gitRepo() {
local oldPath="${PWD}"

cd "$(git rev-parse --show-toplevel)"

VCS_TYPE="git"
Expand Down Expand Up @@ -172,10 +174,14 @@ gitRepo() {

# Date of the current commit
VCS_DATE="$(git log -1 --pretty=format:%ci | sed -e 's: :T:' -e 's: ::')"

cd "${oldPath}"
}

# For hg repos
hgRepo() {
local oldPath="${PWD}"

cd "$(hg root)"

VCS_TYPE="hg"
Expand Down Expand Up @@ -217,10 +223,14 @@ hgRepo() {

# Date of the current commit
VCS_DATE="$(hg log -r "${VCS_NUM}" -l 1 --template '{date|isodatesec}\n' 2>/dev/null | sed -e 's: :T:' -e 's: ::')"

cd "${oldPath}"
}

# For bzr repos
bzrRepo() {
local oldPath="${PWD}"

cd "$(bzr root)"

VCS_TYPE="bzr"
Expand Down Expand Up @@ -258,11 +268,15 @@ bzrRepo() {

# Date of the current commit
VCS_DATE="$(bzr version-info --custom --template='{date}\n' | sed -e 's: :T:' -e 's: ::')"

cd "${oldPath}"
}

# For svn repos
# shellcheck disable=SC2155
svnRepo() {
local oldPath="${PWD}"

VCS_TYPE="svn"

case "${PWD}" in
Expand Down Expand Up @@ -348,6 +362,8 @@ svnRepo() {

# Date of the current commit
VCS_DATE="$(svn info --xml | sed -n -e 's:<date>::' -e 's:</date>::' -e 's:Z:-0000:p')"

cd "${oldPath}"
}


Expand Down

0 comments on commit 167b750

Please sign in to comment.