Commit Graph

760 Commits

Author SHA1 Message Date
Matt Mackall
5a705b3a5d merge with stable 2012-03-30 14:35:06 -05:00
Mads Kiilerich
08bbe3eb2b mq: fix qpush --move with comments in series file between applied patches
The 'start' variable pointed to qtip in self.series, but it was used for
indexing self.fullseries.

When fullseries had holes and the patch was moved to self.fullseries[start]
it would end up too early in self.series and it could thus not be
found in self.series[start:] and it would crash.

Now the 'fullstart' index in fullseries is found used instead.
2012-03-29 00:35:00 +02:00
Matt Mackall
7f2dc15daf merge with stable 2012-03-27 14:37:17 -05:00
Pierre-Yves David
a6a8d8d05e qfinish: comply with the phases.new-commit option in secret mode (issue3335)
In secret mode qfinished changeset were move to the draft phase in all case[1]
without regard to phases.new-commit value

This changeset ensure qfinish does not automatically promote a changeset
further than the phases.new-commit value.

Note: This may also result in qfinished changeset made public if
phases.new-commit is set to public.

[1] "In all case" where parent have a compatible phase. Qfinish keep never
    altering phases of changeset not involved in the qfinish.
2012-03-24 12:06:49 +01:00
Matt Mackall
39c1d7334a merge with stable 2012-03-22 17:08:05 -05:00
Matt Mackall
73fcdcd76c strip: ignore -n (issue3326) (BC)
-n could be confused for --dry-run by foolhardy users, resulting in
 permanent data loss.

As leaving a backup when none was requested is significantly less
disastrous, the short option is silently ignored. Old scripts continue
to work, users only get lightly burned.
2012-03-22 17:07:39 -05:00
Matt Mackall
87d3671dbf merge with stable 2012-03-12 17:05:42 -05:00
Wagner Bruna
9653f097ec strip: enhance repair.strip to receive a list of nodes (issue3299)
Originally, mq.strip called repair.strip a single rev at a time.
repair.strip stores in a backup bundle any revision greater than
the revision being stripped, strips, then restores the backup with
repo.addchangegroup. So, when stripping revisions on more than one
topological branch, some could end up being restored from the backup
bundle, only to be later removed by a subsequent repair.strip call.

But repo.addchangegroup calls hooks for all those restore operations.
And 1671d21e8e41 changed it to delay all hook calls until the
repository lock were released - by mq.strip, after stripping all
revisions. Thus, the hooks could be called over revisions already
removed from the repository at that point.

By generating the revision lists at once inside repo.strip, we avoid
calling addchangegroup for temporary restores. Incidentally, this
also avoids creating many backup files for a single strip command.
2012-03-12 17:02:45 -03:00
Matt Mackall
f2a652218a i18n: fix all remaining uses of % inside _() 2012-03-08 13:35:27 -06:00
Patrick Mezard
9d058db6bd mq: fix qapplied --last and qprev documentation (issue3282)
qapplied --last is qprev not qtop.

v2:
- Replace "previous" with "preceding" as suggested here and there
2012-02-27 18:23:18 +01:00
Idan Kamara
01edf134f8 mq: no need to delete undo files after strip
repair.strip takes care of that
2012-03-06 18:43:05 +02:00
Matt Mackall
7f2d6a6af7 merge with stable 2012-03-08 15:59:33 -06:00
Matt Mackall
38ab0032cb merge with stable 2012-02-28 21:17:53 -06:00
Matt Mackall
272058d456 mq: expand qimport summary 2012-02-22 17:41:22 -06:00
Patrick Mezard
3141b1aa35 mq: make qimport --push push all imported patches (issue3130)
Only the first imported one was pushed.
2012-02-14 14:31:40 +01:00
Patrick Mezard
7b9cb90b98 mq: restore _branchtags() fast path (issue3223)
Since c06eb45e85a7, mq saves the nodeid of the first applied patch to
cache/branchheads, which breaks the optimized cache handling introduced in
1808e27e1362. The problem is the revision being committed is appended to
mqrepo.applied after the commit succeeds, which means mqrepo._branchtags()
performs a regular update and write the first applied patch to the branch
cache.

One solution is to set a context variable _committingpatch on the mqrepo while
it is committing a patch and to take it in account when deciding to fast-path
mqrepo._branchtags(). Not really elegant but it works.

The changes to test-mq-caches.t reverse changes introduced by c06eb45e85a7. The
cache should not have been updated with mq records.

The changes to test-keyword.t are indirectly caused by c06eb45e85a7.

Reported and analyzed by Yuya Nishihara <yuya@tcha.org>

Notes:
- qpush still makes a slow path _branchtags() call when checking heads. Maybe
  this can be optimized.
- be careful when merging this patch in default as secretcommit() was renamed
  newcommit() right after the end of the code freeze.
2012-02-07 18:47:16 +01:00
Patrick Mezard
4ddca18cf5 mq: ensure all mq commits are made with secretcommit()
Having a common code path helps fixing things globally.
2012-02-07 18:47:13 +01:00
Patrick Mezard
b7f936bb8a mq: make qprev return the previous applied patch (issue3245)
The current behaviour is to return the previous one in the series but at the
same time the implementation is buggy because it does not take guarded patches
in account.
2012-02-03 19:47:09 +01:00
Patrick Mezard
0b8c39f5e8 mq: fix qnext when all remaining patches are guarded
When all remaining patches are guarded, qnext used to return the last of the
queue anyway.
2012-02-03 19:38:31 +01:00
Pierre-Yves David
55aec6a384 mq: prevent rewriting operation on public changeset
The following operation are denied if the mq changeset is public

* qrefresh
* qpop
* qfold

note: qimport was already denied.
2012-02-01 12:20:10 +01:00
Matt Mackall
cde4dd99cb qpush: avoid trying to manage existing history (issue2218) 2012-01-31 23:13:04 -06:00
Matt Mackall
94245d0910 mq: fix secret description in help 2012-01-30 16:04:14 -06:00
Pierre-Yves David
13fe947391 qfinish: do not set secret changeset to draft if mq.secret=false
If mq.secret=false, mq should not touch phase
2012-01-30 15:17:08 +01:00
Pierre-Yves David
24ebf577e2 mq: take mq.secret configuration into account when picking the default phase 2012-01-30 17:39:05 +01:00
Pierre-Yves David
7728bdc44c qimport: when mq.secret=True set qimported revision as secret 2012-01-30 17:37:45 +01:00
Pierre-Yves David
d05f57b256 qrefresh: keep changeset phase during refresh 2012-01-30 17:36:30 +01:00
Matt Mackall
f549014354 mq: add secret setting 2012-01-29 12:59:21 -06:00
Matt Mackall
ee1d294b90 merge with stable 2012-02-16 16:40:29 -06:00
Matt Mackall
0d314915f7 merge with stable 2012-02-10 13:47:57 -06:00
Matt Mackall
153d38819f merge with stable 2012-02-03 15:45:13 -06:00
Pierre-Yves David
2e7e0826c5 mq: rename secretcommit to newcommit
This function create secret changeset only when mq.secret is true
2012-01-30 00:05:28 +01:00
Augie Fackler
b7b4c9e86d mq: pass qbase node instead of mq statusentry in phasedefaults
This was breaking my remotebranches extension in a completely
mystifying way, because repo.lookup was failing to resolve the
statusentry. I'm not sure how this works absent my remotebranches
extension, but doing it this way looks more correct and doesn't break
anything.
2012-01-21 21:39:27 -06:00
Pierre-Yves David
f813e53446 mq-safety: don't apply safety on non-outgoing changeset
When mq changeset are secret, they don't appear in outgoing and won't be
pushed. So it's not necessary to abort the push.

The checkpush call is protected by lock to prevent race on phase.
2012-01-20 18:45:29 +01:00
Matt Mackall
dbc9adfaa2 qimport: back out 1b64707da148
This patch presumed mq csets must always be secret, which isn't yet
established.
2012-01-19 11:35:06 -06:00
Pierre-Yves David
e813bac048 qfinish: set all qfinished patch as draft, not only qbase
Fix a silly bug.
2012-01-19 11:30:37 +01:00
Pierre-Yves David
73e1481d91 mq: ensure mq changesets are set to secret when no phase data are found 2012-01-18 17:18:38 +01:00
Pierre-Yves David
c4a53864db mq: qimporting revision set them to secret 2012-01-17 02:26:00 +01:00
Pierre-Yves David
3025e16875 mq: have mq create secret changeset only 2012-01-18 16:53:49 +01:00
Matt Mackall
a7e9cf682f qclone: ignore local qbase if secret 2012-01-18 19:16:01 -06:00
Pierre-Yves David
03d7b0dd77 qclone: add a few comment and blank line
This help readability.
2012-01-18 17:11:27 +01:00
Pierre-Yves David
e5a73a5bfb mq: turn changeset draft on qfinish (except if qparent is secret)
As mq automatically sets changesets as secret, it should make them draft when he
is done with it. We do not move them automatically to draft when we detect that
something else have also set them as secret through their parents.
2012-01-18 17:06:59 +01:00
Mads Kiilerich
b33a1b4058 mq: only save dirty files once when savedirty is called multiple times 2012-01-11 02:29:56 +01:00
Mads Kiilerich
5c89f9299b mq: remove early wlock release in qnew
It seems like something that missed the refactoring in bc2ce38db658.
2012-01-11 02:29:56 +01:00
Mads Kiilerich
b81d19317c mq: use .invalidate to cancel dirty mq state when cancelling transaction
Before the code optimistically relied on savedirty not being called a cancelled
transaction. If it was called it could save incorrect data.

Instead we now start using the invalidate method introduced in 469ecb6e5f24.
2012-01-11 02:29:55 +01:00
Mads Kiilerich
e5b01f05d2 mq: make qsave implementation more explicit
It wasn't obvious from the code how qsave mocked around with .hg/patches and
.hg/patches.? and what was going on.

This makes it more explicit so it will survive future refactorings.
2012-01-11 02:29:55 +01:00
Mads Kiilerich
10f59ac102 mq: consistently use boolean values for dirty flags 2012-01-11 02:28:36 +01:00
Mads Kiilerich
8af4e82c6b mq: minor cleanup 2012-01-11 02:28:12 +01:00
Matt Mackall
0fb748c56c merge with stable 2012-01-09 20:16:57 -06:00
Olav Reinert
16da43099e mq: Document that qdel requires exact patch identifiers 2012-01-06 15:05:51 +01:00
Patrick Mezard
0a3c1ef904 mq: avoid data loss upon qfold + qmv (issue3058)
When renaming a patch A as B where B was previously qfolded into A and
therefore marked as removed, a versioned MQ would first restore B before
marking it as a copy of A, thus losing A changes. The undelete() call is
probably a left-over, wctx.copy() explicitely handles the case where the
destination is removed.

Also note that status command represents "hg rm b; hg mv a b" as:

  A b
    a
  R a

which explains the first hunk in test-mq-qrename.t.
2011-10-20 16:43:31 +02:00