Commit Graph

26326 Commits

Author SHA1 Message Date
Gijs Kruitbosch
5b5d0b9759 hgweb: fix border-radius for standards-based browsers
While here, remove an old gecko-specific property, as gecko has
supported the unprefixed version for many years.
2015-10-07 20:19:20 +01:00
Siddharth Agarwal
1f3c72862f filemerge: move precheck to before files are written out
This is much simpler, and also avoids unnecessary disk IO.
2015-10-07 21:28:43 -07:00
Siddharth Agarwal
545f983ef8 filemerge: move 'merging' output to before file creation
This has no visible impact but makes some future work simpler.
2015-10-07 22:58:52 -07:00
Siddharth Agarwal
7ea14fa915 filemerge.filemerge: make a tuple containing merge paths on disk
We're going to need this same tuple elsewhere.
2015-10-07 21:21:56 -07:00
Siddharth Agarwal
6b1725d26f filemerge: switch trymerge boolean to mergetype enum
trymerge = False becomes mergetype = nomerge, and trymerge = True becomes
mergetype = fullmerge or mergeonly, depending on whether a premerge happens.
2015-10-07 16:14:57 -07:00
Siddharth Agarwal
36f6f22a1e filemerge: add some merge types
We're going to turn the 'trymerge' boolean into a 'mergetype' enum with these
three possible values.
2015-10-07 15:13:41 -07:00
FUJIWARA Katsunori
012bda5d3c shelve: restore unshelved dirstate explicitly after aborting transaction
Before this patch, "hg unshelve" uses aborting a current transaction
to discard temporary changes while unshelving.

This assumes that dirstate changes in a transaction scope are kept
even after aborting it. But this assumption will be broken by
"transactional dirstate". See the wiki page below for detail about it.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

This patch explicitly saves shelved dirstate just before aborting
current transaction, and restore dirstate with it after aborting by
utility function '_aborttransaction()' added by previous patch.
2015-10-08 01:41:30 +09:00
FUJIWARA Katsunori
b46183c6ee shelve: restore shelved dirstate explicitly after aborting transaction
Before this patch, "hg shelve" uses aborting a current transaction to
discard temporary changes while shelving.

This assumes that dirstate changes in a transaction scope are kept
even after aborting it. But this assumption will be broken by
"transactional dirstate". See the wiki page below for detail about it.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

This patch explicitly saves shelved dirstate just before aborting
current transaction, and restore dirstate with it after aborting by
utility function '_aborttransaction()' added by previous patch.

This patch replaces 'if tr: tr.abort()' by 'lockmod.release(tr)',
because the former is already done in '_aborttransaction()' (and the
latter has no effect), if current transaction is aborted in it
successfully. Otherwise, the latter is enough to trigger aborting.
2015-10-08 01:41:30 +09:00
FUJIWARA Katsunori
6200027e0d shelve: add utility to abort current transaction but keep dirstate
"hg shelve" and "hg unshelve" use aborting a current transaction to
discard temporary changes while (un)shelving.

This assumes that dirstate changes in a transaction scope are kept
even after aborting it. But this assumption will be broken by
"transactional dirstate". See the wiki page below for detail about it.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

This patch adds utility function "_aborttransaction()" to abort
current transaction but keep dirstate changes for (un)shelving.

'dirstate.invalidate()' just after aborting a transaction should be
removed soon by subsequent patch, which writes or discards in-memory
dirstate changes at releasing transaction according to the result of
it.

BTW, there are some other ways below, which (seem to, at first glance)
resolve this issue. But this patch chose straightforward way for ease
of review and future refactorring.

  - commit transaction at first, and then rollback it

    It causes unintentional "dirty read" of running transaction to
    other processes at committing it.

  - use dirstateguard to save and restore shelved dirstate

    After DirstateTransactionPlan, making 'dirstate.write()' write
    in-memory changes into actual file requires
    'transaction.writepending()' while transaction running.

    It causes meaningless writing other in-memory changes out, even
    though they are never referred.

    In addition to it, it isn't desirable that scope of dirstateguard
    and transaction intersects each other.

  - get list of files changed from the parent, keep it in memory, and
    emulate that changes after aborting transaction

    This additional memory consumption may block aborting transaction
    in large repository (on small resource environment).
2015-10-08 01:41:30 +09:00
FUJIWARA Katsunori
0602f8209b dirstate: split write to write changes into files other than .hg/dirstate
'_writedirstate()' is used mainly for "transactional dirstate". See
the wiki page below for detail about it.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan
2015-10-08 01:41:30 +09:00
FUJIWARA Katsunori
5b79d1f206 bookmarks: use recordchange instead of writing if transaction is active
Before this patch, 'bmstore.write()' always write in-memory bookmark
changes into '.hg/bookmarks' regardless of transaction activity.

If 'bmstore.write()' is invoked inside a transaction and it writes
changes into '.hg/bookmarks', then:

  - original bookmarks aren't restored at failure of that transaction

    This breaks "all or nothing" policy of the transaction.

    BTW, "hg rollback" can restore bookmarks successfully even before
    this patch, because original bookmarks are saved into
    '.hg/journal.bookmarks' at the beginning of the transaction, and
    it (actually renamed as '.hg/undo.bookmarks') is used by "hg
    rollback".

  - uncommitted bookmark changes are visible to other processes

    This is a kind of "dirty read"

For example, 'rebase.rebase()' implies 'bmstore.write()', and it may
be executed inside the transaction of "hg unshelve". Then, intentional
aborting at the end of "hg unshelve" transaction doesn't restore
original bookmarks (this is obviously a bug).

This patch uses 'bmstore.recordchange()' instead of actual writing by
'bmstore._writerepo()', if any transaction is active

This patch also removes meaningless restoring bmstore explicitly at
the end of "hg shelve".

This patch doesn't choose fixing each 'bmstore.write()' callers as
like below, because writing similar code here and there is very
redundant.

  before:
    bmstore.write()

  after:
    tr = repo.currenttransaction()
    if tr:
        bmstore.recordchange(tr)
    else:
        bmstore.write()

Even though 'bmstore.write()' itself may have to be discarded by
putting bookmark operations into transaction scope, this patch chose
fixing it to implement "transactional dirstate" at first.
2015-10-08 01:41:30 +09:00
Siddharth Agarwal
dbdf9ec262 filemerge: run symlink check for :merge3
Just like :merge, :merge3 doesn't support merging symlinks.
2015-10-07 00:27:23 -07:00
Siddharth Agarwal
bedfe886f8 filemerge: print correct name of tool for symlink checks
Earlier we'd print ':merge' even if the tool was something else like ':union'.
That's clearly a bug.
2015-10-07 00:24:44 -07:00
Siddharth Agarwal
30c73e4dd2 filemerge: normalize 'internal:foo' names to ':foo'
In upcoming patches we're going to present these names in the UI -- it would be
good not to present deprecated names.
2015-10-07 00:01:16 -07:00
Siddharth Agarwal
aef73939f9 filemerge: use symlinkcheck for :merge and :union
This exposes a couple of bugs, both of which will be fixed in upcoming patches.
2015-10-06 22:57:21 -07:00
Siddharth Agarwal
258f79e559 filemerge: add a precheck for symlinks
This will be used by internal merge tools.
2015-10-06 22:56:33 -07:00
Siddharth Agarwal
11ffaa85a2 filemerge: call precheck if available
In upcoming patches we'll define a precheck function for some merge tools.
2015-10-06 22:55:21 -07:00
Siddharth Agarwal
3226585b5b filemerge: add a before-merge callback to internal merge tools
We're going to separate the pre-merge and merge steps for merge tools. The
merge step will be specific to the tool, but the pre-merge step will be common
to all merge tools that need it.

However, some merge tools run checks *before* the pre-merge step. This callback
will allow that to continue to work.
2015-10-06 22:54:14 -07:00
Siddharth Agarwal
6e9048d788 filemerge: indent filemerge.filemerge
This will make upcoming patches much easier to review.
2015-10-06 17:39:13 -07:00
Pierre-Yves David
50e5ae9a7a test-bundle-type: replace unbundle with debugbundle
We now have a convenient command to look at bundle contents, let's use
it.
2015-10-01 20:15:00 -07:00
Pierre-Yves David
63b3b90838 bundle: extract the parsing of the bundle type in a function
We are going to introduce significant extensions of the bundle parsing code to
support creation of bundle2 through the bundle command. As an early step, we
extract the logic in its own function.
2015-10-01 18:01:24 -07:00
Pierre-Yves David
52f209c327 changegroup: add version argument to getchangegroup
For some obscure reasons (probably upsetting a Greek goddess),
getchangegroup did not had a 'version' argument to control the changegroup
version. We fixes this to allow cg02 to be used with 'hg bundle' in the future.
2015-10-01 19:14:47 -07:00
Pierre-Yves David
905bd41a77 changegroup: add version argument to getlocalchangegroup
For some obscure reasons (probably upsetting a Greek goddess),
getlocalchangegroup did not have a 'version' argument to control the
changegroup version. We fix this to allow cg02 to be used with 'hg
bundle' in the future.
2015-10-01 19:14:33 -07:00
Pierre-Yves David
28c5867b10 shelve: bundle using bundle2 if repository is general delta (issue4862)
This will prevent expensive delta computation on bundling and is similar to what we do
for strip backup.
2015-10-01 15:08:00 -07:00
Pierre-Yves David
06934a921e shelve: move changegroup generation inside writebundle
We will generate different changegroup if general delta is enabled so we gather
this in the lower level function. There wasn't any good reason to have it in
the main code anyway.
2015-10-01 15:09:32 -07:00
Pierre-Yves David
73c8125ae1 shelve: compress on-disk bundle
Shelve is using 'HG10UN' bundle for no obvious reason. Changing this to 'HG10BZ'
as we do for other bundle stored on disk.
2015-09-29 17:14:30 -07:00
Matt Mackall
86f1841884 merge with stable 2015-10-07 13:44:48 -05:00
Bruce Cran
f9dd2d6f9f notify: fix fromauthor setting for 'incoming' hook type (issue4194)
Set the author field in notification emails for the 'incoming' hook type
in addition to 'changegroup' and 'outgoing' types.
2015-10-05 10:43:16 -06:00
Matt Harbison
16d4ee35c6 templater: protect word() from crashing on out of range negative value
The function isn't documented to work with negative values at all, but it does,
which can be useful.  However, the range check didn't account for this.
2015-10-05 12:37:26 -04:00
Siddharth Agarwal
39cdc4468e commands: add a new debug command to print merge state
We're going to be extending the merge state very soon, and this will give us a
way to test all that.
2015-10-02 13:00:47 -07:00
Matt Mackall
e190fd19b1 Added signature for changeset f41404cf41e2 2015-10-01 12:07:20 -05:00
Siddharth Agarwal
7c5424c31f merge.mergestate: factor out code to validate v1/v2 records
We're going to need this in another place in upcoming patches.
2015-09-30 21:22:31 -07:00
Siddharth Agarwal
b91b05d624 localrepo: prevent wlock from being inherited when a transaction is running
Review feedback from Pierre-Yves David. A separate line of work is working to
ensure that dirstate writes are written to a separate 'pending' file while a
transaction is active. Lock inheritance currently conflicts with that, so dodge
the issue by simply preventing inheritance while a transaction is running.

Custom merge drivers aren't going to run inside a transaction, so this doesn't
affect that.
2015-10-06 13:19:05 -07:00
Siddharth Agarwal
eb9c8405ac lock: add a way to prevent locks from being inherited
We want to prevent locks from being inherited sometimes (e.g. when there's a
currently running transaction, which will break a lot of assumptions we're
making in here.)
2015-10-06 13:13:31 -07:00
Siddharth Agarwal
99e4ff5f8b test-fncache: use args/kwargs for lock wrapper
This is annoying to keep up to date, and also just plain unnecessary.
2015-10-06 15:55:50 -07:00
timeless@mozdev.org
28296ec06b rebase: enable histedit for useful help with it 2015-10-06 15:07:00 -04:00
timeless@mozdev.org
23e4331fc3 rebase: suggest help -e histedit
Users unfamiliar with an extension should be reading the
documentation for the feature, not the command.
2015-10-06 15:01:25 -04:00
timeless@mozdev.org
96a106318f rebase: factor out histedit help command 2015-10-06 15:05:40 -04:00
Yuya Nishihara
5715ebc02c util: use tuple accessor to get accurate st_mtime value (issue4836)
Because st.st_mtime is computed as 'sec + 1e-9 * nsec' and double is too narrow
to represent nanoseconds, int(st.st_mtime) can be 'sec + 1'. Therefore, that
value could be different from the one got by osutils.listdir().

This patch fixes the problem by accessing to raw st_mtime by tuple index.

It catches TypeError to fall back to st.st_mtime because our osutil.stat does
not support tuple index. In dirstate.normal(), 'st' is always a Python stat,
but in dirstate.status(), it can be either a Python stat or an osutil.stat.

Thanks to vgatien-baron@janestreet.com for finding the root cause of this
subtle problem.
2015-10-04 22:35:36 +09:00
Yuya Nishihara
ea5724ad42 util: extract stub function to get mtime with second accuracy
This function is trivial but will need a long comment why it can't use
st.st_mtime. See the next patch for details.
2015-10-04 22:25:29 +09:00
Siddharth Agarwal
18a026d1a8 scmutil: add a way for a repo's wlock to be inherited by a subprocess
This is part of a series that will allow locks to be inherited by subprocesses
in limited circumstances.

In the future, we'll call this for custom merge drivers.
2015-10-05 14:37:59 -07:00
Siddharth Agarwal
2357094a49 scmutil: add a way for a subprocess to be run with an inheritable lock
This is part of a series that will allow locks to be inherited by subprocesses
in limited circumstances.

In an upcoming patch, we'll add an API for the wlock to be inherited.
2015-10-05 14:34:52 -07:00
Siddharth Agarwal
faa305db27 localrepo: add a way to get the current wlock if it's held
This will be useful to pass around a reference to the lock to some functions
we're going to add to scmutil. We don't want those functions to live in
localrepo to avoid bloat.
2015-10-05 14:27:37 -07:00
Siddharth Agarwal
02ed78a388 localrepo: add a way to get the current lock if it's held
We'll use this in upcoming patches to return a reference to the wlock if it's
held.
2015-10-05 14:26:53 -07:00
Matt Harbison
f5215c2c04 largefiles: restore archiving largefiles with hgweb (issue4859)
This regressed in f07f4c45a8f2, when trying to conditionally disable archiving
of largefiles.

I'm not sure if wrapfunction() is the right way to do this, but it seems to
work.  The mysterious issue with lfstatus getting out of sync in the proxy and
the unfiltered view crops up again here.  See the referenced cset for more info.
2015-09-29 23:29:44 -04:00
Wagner Bruna
9560b312bd i18n-pt_BR: synchronized with e1c84c9ac25a 2015-10-01 11:09:36 -03:00
Yuya Nishihara
4ffbdfca20 localrepo: recreate phasecache if changelog was modified (issue4855)
Because _phaserevs and _phasesets cache revision numbers, they must be
invalidated if there are new commits or stripped revisions. We could do
that by calling _phasecache.invalidate(), but it wasn't simple to be
integrated with the filecache mechanism.

So for now, phasecache will be recreated after repo.invalidate() if
00changelog.i was modified before.
2015-09-29 21:57:08 +09:00
Pierre-Yves David
9df64adaed unbundle: cleanly abort on unknown bundle2 feature
The exception wasn't caught and resulted in a traceback.
2015-09-25 13:30:49 -07:00
timeless@mozdev.org
b46391de7a test-help: verify that extension keywords appear in help templates
fixed by 7d713b4fcf9b
2015-09-24 13:58:18 -04:00
Anton Shestakov
4a776abb59 monoblue: fix page subtitle on help pages 2015-09-03 22:25:16 +08:00