A Scalable, User-Friendly Source Control System.
Go to file
Martin von Zweigbergk 42c14b3ed1 add: add back forgotten files even when not matching exactly (BC)
I accidentally did 'hg forget .' and tried to undo the operation with
'hg add .'. I expected the files to be reported as either modified or
clean, but they were still reported as removed. It turns out that
forgotten files are only added back if they are listed explicitly, as
shown by the following two invocations. This makes it hard to recover
from the mistake of forgetting a lot of files.

  $ hg forget README && hg add README && hg status -A README
  C README
  $ hg forget README && hg add . && hg status -A README
  R README

The problem lies in cmdutil.add(). That method checks that the file
isn't already tracked before adding it, but it does so by checking the
dirstate, which does have an entry for forgotten files (state 'r'). We
should instead be checking whether the file exists in the
workingctx. The workingctx is also what we later call add() on, and
that method takes care of transforming the add() into a normallookup()
on the dirstate.

Since we're changing repo.dirstate into wctx, let's also change
repo.walk into wctx.walk for consistency (repo.walk calls wctx.walk,
so we're simply inlining the call).
2014-11-10 14:51:18 -08:00
contrib buildrpm: fix use of invalid $PLATFORM in mercurial.repo 2014-11-01 20:00:00 +01:00
doc gendoc: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:23:57 -04:00
hgext merge with stable 2014-11-10 17:29:15 -06:00
i18n spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
mercurial add: add back forgotten files even when not matching exactly (BC) 2014-11-10 14:51:18 -08:00
tests add: add back forgotten files even when not matching exactly (BC) 2014-11-10 14:51:18 -08:00
.hgignore hgignore: ignore the PyCharm workspace folder 2014-10-13 11:46:04 +02:00
.hgsigs Added signature for changeset e5270c957a24 2014-11-01 22:48:49 -05:00
CONTRIBUTORS Add note to CONTRIBUTORS file 2007-11-07 21:10:30 -06:00
COPYING COPYING: refresh with current address from fsf.org 2011-06-02 11:17:02 -05:00
hg hg: add support for HGUNICODEPEDANTRY environment variable 2014-06-23 09:33:07 -04:00
hgeditor Fixed a bashism with the use of $RANDOM in hgeditor. 2010-05-19 18:06:35 +02:00
hgweb.cgi mq: add a warning about uncommitted changes for qfinish 2011-11-10 15:40:34 -06:00
Makefile Makefile: update .PHONY 2014-11-01 20:00:31 +01:00
README readme: mention how to run in-place 2012-03-02 21:43:55 +02:00
setup.py config: introduce "built-in" default configuration settings in default.d 2014-09-04 21:36:35 +02:00

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

 $ make            # see install targets
 $ make install    # do a system-wide install
 $ hg debuginstall # sanity-check setup
 $ hg              # see help

Running without installing:

 $ make local      # build for inplace usage
 $ ./hg --version  # should show the latest version

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.