Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hg branch shows error from cat if .hg/branch does not exist yet #40

Open
edbrannin opened this issue Sep 24, 2011 · 1 comment
Open

Comments

@edbrannin
Copy link

Steps to repro:

  1. Use these settings and PS1="\$(${dvcs_function})\[$COLOR_RESET\] \h:\W \u\$ "
  2. $ hg init empty
  3. cd empty

Expected:

(default) Ed-Brannins-MacBook-Pro:empty ed$ 

Observed:

cat: /Users/ed/tmp/empty/.hg/branch: No such file or directory
() Ed-Brannins-MacBook-Pro:empty ed$ 

I tried replacing this line:

# If we are in mercurial ...
if [ -n \"\$_hg_dir\" ]; then
    hgBranch=\`cat \"\$_hg_dir/.hg/branch\"\`

with this one:

# If we are in mercurial ...
if [ -n \"\$_hg_dir\" ]; then
    hgBranch=`hg branch`

...but now I get this upon opening a new shell, which is why this isn't a pull request:

abort: no repository found in '/Users/ed' (.hg not found)!
@AndrewRayCode
Copy link
Owner

confirmed, will fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants