obsolete: properly drop 'date' from metadata

Mistakes were made while resolving rebase conflicts in 4bc96685a40c. This led to
'date' being preserved in metadata when reading markers from a binary stream.

As a result, some known markers were seen as "new" when pulling. I noticed it
because a no-op pulls from main added about 600 duplicated markers to my
obsstore (for each pull).

I do not believe we need to perform any specific action to actively
de-duplicates existing obsstore. After this fix, duplicated markers will no be
propagated and the few affected repositories can probably deal with duplication (or
people can repull the obsstore from a clone).

As a side effect, we decode metadata only once, reducing the impact of the hack
in fm0 to store extra important data (parents and date).
revert: cache working context in a variable

During the silicon age, humans on planet Earth discovered the use of
variables. This marvelous invention let them improve both code
readability and performance.
revert: detect unknown files in the same path as files marked as removed

Such unknown files may need to be backed up. Having them identified beforehand
will help simplify the backup logic.

We now use different sets with different backup strategies.

--HG--
extra : rebase_source : 0fc65d7f8223e67bf67b0c4cf942e5d9bc8f6a6c
revert: distinguish between deleted file and locally modified

Locally modified needs a backup while a deleted file cannot be backed
up because there is no file to backup.

--HG--
extra : rebase_source : 4baef98e1bb745348f2b181204a8355f0ec0e1a9
revert: drop `lexist` check in the backup logic

We are no longer trying to backup files that do not exist on disk. This check
can be safely dropped.

--HG--
extra : rebase_source : ce204b1f77837f1204b0a50b104fcc7a51cb4b51
parsers: use bitmask type consistently in find_gca_candidates

Normalized type usage in find_gca_candidates triggered by warning from
Microsoft Visual C++ 2008.

--HG--
extra : rebase_source : 87db09bc5e102f3176d229824fd89eea783eabbd
extra : histedit_source : 924794077a578f3642689f4770cd0d49818d5ea6
parsers: fix typing issue when constructing Python integer object

The passed variable is a Py_ssize_t, not a long, and consequently should use
PyInt_FromSsize_t rather than PyInt-FromLong. Fixed based on warning from
Microsoft Visual C++ 2008.

--HG--
extra : rebase_source : 4e3a813799faf185102e52c27492f49509ebd099
extra : __touch-noise__ : 2235567756
extra : histedit_source : 91710beb221c394f14fc648dd087cf274010550f
parsers: ensure correct return type for inline_scan

The returned data type for inline_scan should be Py_ssize_t rather than long.
Based on warning from Microsoft Visual C++ 2008.

--HG--
extra : rebase_source : aaabd3ae06ed2ccfe3d80e9c19231b5f12bffd10
parsers: use correct type for file offset

Now using Py_ssize_t instead of long to denote offset in file whose length is
already measured using Py_ssize_t. Length and offset are now consistent. Based
on warning from Microsoft Visual C++ 2008.

--HG--
extra : rebase_source : 82110a08a8d82c3980e95a2b494558611941bcfc
parsers: avoid signed/unsigned comparison mismatch

Based on warning from Microsoft Visual C++ 2008.

--HG--
extra : rebase_source : 4c8a6192704529c8dd1a4811008b6d2dc129a32b
dirstate: add begin/endparentchange to dirstate

It's possible for the dirstate to become incoherent (issue4353) if there is an
exception in the middle of the dirstate parent and entries being written (like
if the user ctrl+c's). This change adds begin/endparentchange which a future
patch will require to be set before changing the dirstate parent.  This will
allow us to prevent writing the dirstate in the event of an exception while
changing the parent.

--HG--
extra : rebase_source : 50aae72ca33f7cbf42437758c2930fff31b64b65
dirstate: wrap setparent calls with begin/endparentchange (issue4353)

This wraps all the locations of dirstate.setparent with the appropriate
begin/endparentchange calls. This will prevent exceptions during those calls
from causing incoherent dirstates (issue4353).

--HG--
extra : rebase_source : ab0c0bf54c1722d5c6bd045a9e46703191416372
dirstate: add test for exceptions during updates

Adds a test that checks if the working copy parent and the working copy are in a
good state if an exception happens between the time the working copy parent is
set and the time the actual updates are recorded in the dirstate.

--HG--
extra : rebase_source : 11489364417181ef3b8b2445957239e77226c2b8
dirstate: add exception when calling setparent without begin/end (API)

Adds an exception when calling dirstate.setparent without having first called
dirstate.beginparentchange. This will prevent people from writing code that
modifies the dirstate parent without considering the transactionality of their
change.

This will break third party extensions that call setparents.

--HG--
extra : rebase_source : ff94b01e66f87dff40cccceac896492042497121
manifest: move checkforbidden to module-level

There's no need for this function to be nested, so let's just define
it once instead of every time manifest.add() gets called.

--HG--
extra : rebase_source : 47cd044a039f9fb3e8ac49bd930d477d3536f383
manifest: move addlistdelta to module-level

Again, there's no reason for this to be inside manifest.add, so we'll
define it only once.

--HG--
extra : rebase_source : d1d0af07045afba42ca799e8121eb322f10d2671
test-convert-svn-move.t: remove stray '

--HG--
extra : rebase_source : 8f0292f2aeabf74d090b768500ee07300bd8a0b6
convert: add support for deterministic progress bar on scanning phase

This makes it possible to estimate how long the "scanning source"
phase will take, if the specified source repo type supports a quick
"how many changes" check.

--HG--
extra : rebase_source : 741e7c946921d4eaf214547184dcc4b07625234d
test-convert-git.t: add a test of convert progress bars for git

We're about to enhance this support, so test the existing behavior so
the improved behavior is obvious in the next patch.

--HG--
extra : rebase_source : c63be2e57aba847e877f17b6c3a0f0f7c9739c46
convert: enable deterministic conversion progress bar for git

--HG--
extra : rebase_source : c9e5923bab5e0c23f3dba8ad8221cc02fba1e675