zshrc: Remove Fossil stuff
This commit is contained in:
parent
945a7b4f96
commit
d505bfc71d
1 changed files with 2 additions and 98 deletions
100
zshrc
100
zshrc
|
@ -157,12 +157,8 @@ set_prompt
|
||||||
__precmd() {
|
__precmd() {
|
||||||
__update_terminal_cwd
|
__update_terminal_cwd
|
||||||
|
|
||||||
local branch=$(fossil branch current 2>/dev/null)
|
branch=$(git symbolic-ref HEAD 2>/dev/null)
|
||||||
|
branch=${branch##refs/heads/}
|
||||||
if [ -z "$branch" ]; then
|
|
||||||
branch=$(git symbolic-ref HEAD 2>/dev/null)
|
|
||||||
branch=${branch##refs/heads/}
|
|
||||||
fi
|
|
||||||
|
|
||||||
set_prompt $branch
|
set_prompt $branch
|
||||||
}
|
}
|
||||||
|
@ -274,98 +270,6 @@ if ! __has_command colordiff; then
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if __has_command fossil; then
|
|
||||||
alias fl="fossil"
|
|
||||||
alias flc="fossil changes --differ"
|
|
||||||
|
|
||||||
fld() {
|
|
||||||
fossil diff -N "$@" | colordiff | less -FRX
|
|
||||||
}
|
|
||||||
|
|
||||||
flpu() {
|
|
||||||
fossil pull && fossil update "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
flgrep() {
|
|
||||||
local ret=1
|
|
||||||
fossil changes --all . | awk '{print $2}' | while read file; do
|
|
||||||
grep -H "$@" "$file" && ret=0
|
|
||||||
[ $? -gt 1 ] && return $?
|
|
||||||
done
|
|
||||||
return $ret
|
|
||||||
}
|
|
||||||
|
|
||||||
flveri() {
|
|
||||||
rev="${1-current}"
|
|
||||||
echo -e "\033[1m$rev\033[0m"
|
|
||||||
fossil artifact "$rev" | gpg --verify
|
|
||||||
}
|
|
||||||
|
|
||||||
flunci() {
|
|
||||||
fossil up previous && \
|
|
||||||
fossil diff -N --checkin tip | patch -p0 && \
|
|
||||||
fossil purge checkins tip
|
|
||||||
}
|
|
||||||
|
|
||||||
git2fl() {
|
|
||||||
local gitdir=$(git rev-parse --show-toplevel)/.git
|
|
||||||
local repo=$(fossil info | awk '/^repository:/ { print $2 }')
|
|
||||||
|
|
||||||
[ -z "$repo" ] && repo="$1"
|
|
||||||
|
|
||||||
[ -n "$repo" -a -f "$repo" ] &&
|
|
||||||
local incremental="--incremental"
|
|
||||||
|
|
||||||
[ -f "$gitdir/git.marks" ] &&
|
|
||||||
local importmarks_git="--import-marks=$gitdir/git.marks"
|
|
||||||
|
|
||||||
if [ -f "$gitdir/fossil.marks" ]; then
|
|
||||||
local importmarks_fossil
|
|
||||||
importmarks_fossil="--import-marks $gitdir/fossil.marks"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LC_ALL=C git fast-export \
|
|
||||||
--signed-tags=warn-strip \
|
|
||||||
--export-marks=$gitdir/git.marks \
|
|
||||||
$=importmarks_git \
|
|
||||||
--all |
|
|
||||||
LC_ALL=C fossil import \
|
|
||||||
--git \
|
|
||||||
$=incremental \
|
|
||||||
--rename-master trunk \
|
|
||||||
--export-marks $gitdir/fossil.marks \
|
|
||||||
$=importmarks_fossil \
|
|
||||||
$repo
|
|
||||||
}
|
|
||||||
|
|
||||||
fl2git() {
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
local gitdir="$1/.git"
|
|
||||||
else
|
|
||||||
local gitdir=$(git rev-parse --show-toplevel)/.git
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f "$gitdir/git.marks" ] &&
|
|
||||||
local importmarks_git="--import-marks=$gitdir/git.marks"
|
|
||||||
|
|
||||||
if [ -f "$gitdir/fossil.marks" ]; then
|
|
||||||
local incremental="--incremental"
|
|
||||||
local importmarks_fossil
|
|
||||||
importmarks_fossil="--import-marks $gitdir/fossil.marks"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LC_ALL=C fossil export \
|
|
||||||
--git \
|
|
||||||
$=incremental \
|
|
||||||
--rename-trunk master \
|
|
||||||
--export-marks $gitdir/fossil.marks \
|
|
||||||
$=importmarks_fossil |
|
|
||||||
LC_ALL=C git fast-import \
|
|
||||||
--export-marks=$gitdir/git.marks \
|
|
||||||
$=importmarks_git
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if __has_command cvs; then
|
if __has_command cvs; then
|
||||||
cvsd() {
|
cvsd() {
|
||||||
cvs diff -uN "$@" | colordiff | less -FRX
|
cvs diff -uN "$@" | colordiff | less -FRX
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue