mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2025-11-04 13:21:19 +08:00 
			
		
		
		
	no tabs in a space-d file
This commit is contained in:
		
							parent
							
								
									7a7eda1287
								
							
						
					
					
						commit
						3930a63253
					
				@ -95,38 +95,38 @@ prompt_git() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
prompt_hg() {
 | 
			
		||||
	local rev status
 | 
			
		||||
	if $(hg id >/dev/null 2>&1); then
 | 
			
		||||
		if $(hg prompt >/dev/null 2>&1); then
 | 
			
		||||
			if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
 | 
			
		||||
				# if files are not added
 | 
			
		||||
				prompt_segment red white
 | 
			
		||||
				st='±'
 | 
			
		||||
			elif [[ -n $(hg prompt "{status|modified}") ]]; then
 | 
			
		||||
				# if any modification
 | 
			
		||||
				prompt_segment yellow black
 | 
			
		||||
				st='±'
 | 
			
		||||
			else
 | 
			
		||||
				# if working copy is clean
 | 
			
		||||
				prompt_segment green black
 | 
			
		||||
			fi
 | 
			
		||||
			echo -n $(hg prompt "☿ {rev}@{branch}") $st
 | 
			
		||||
		else
 | 
			
		||||
			st=""
 | 
			
		||||
			rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
 | 
			
		||||
			branch=$(hg id -b 2>/dev/null)
 | 
			
		||||
			if `hg st | grep -Eq "^\?"`; then
 | 
			
		||||
				prompt_segment red black
 | 
			
		||||
				st='±'
 | 
			
		||||
			elif `hg st | grep -Eq "^(M|A)"`; then
 | 
			
		||||
				prompt_segment yellow black
 | 
			
		||||
				st='±'
 | 
			
		||||
			else
 | 
			
		||||
				prompt_segment green black
 | 
			
		||||
			fi
 | 
			
		||||
			echo -n "☿ $rev@$branch" $st
 | 
			
		||||
		fi
 | 
			
		||||
	fi
 | 
			
		||||
  local rev status
 | 
			
		||||
  if $(hg id >/dev/null 2>&1); then
 | 
			
		||||
    if $(hg prompt >/dev/null 2>&1); then
 | 
			
		||||
      if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
 | 
			
		||||
        # if files are not added
 | 
			
		||||
        prompt_segment red white
 | 
			
		||||
        st='±'
 | 
			
		||||
      elif [[ -n $(hg prompt "{status|modified}") ]]; then
 | 
			
		||||
        # if any modification
 | 
			
		||||
        prompt_segment yellow black
 | 
			
		||||
        st='±'
 | 
			
		||||
      else
 | 
			
		||||
        # if working copy is clean
 | 
			
		||||
        prompt_segment green black
 | 
			
		||||
      fi
 | 
			
		||||
      echo -n $(hg prompt "☿ {rev}@{branch}") $st
 | 
			
		||||
    else
 | 
			
		||||
      st=""
 | 
			
		||||
      rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
 | 
			
		||||
      branch=$(hg id -b 2>/dev/null)
 | 
			
		||||
      if `hg st | grep -Eq "^\?"`; then
 | 
			
		||||
        prompt_segment red black
 | 
			
		||||
        st='±'
 | 
			
		||||
      elif `hg st | grep -Eq "^(M|A)"`; then
 | 
			
		||||
        prompt_segment yellow black
 | 
			
		||||
        st='±'
 | 
			
		||||
      else
 | 
			
		||||
        prompt_segment green black
 | 
			
		||||
      fi
 | 
			
		||||
      echo -n "☿ $rev@$branch" $st
 | 
			
		||||
    fi
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Dir: current working directory
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user