Commit Graph

3328 Commits

Author SHA1 Message Date
Matt Mackall
a7e9cf682f qclone: ignore local qbase if secret 2012-01-18 19:16:01 -06:00
Matt Mackall
87405b610a rebase: only advance phase on successful commit 2012-01-18 18:14:55 -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
Alain Leufroy
fd923bd6e3 rebase: fix phases movement
Rebase now try to keep the phases of source changesets.
2012-01-17 09:12:14 +01:00
Na'Tosha Bard
1e5b58f8a8 largefiles: cache new largefiles for new heads when pulling
When the user pulls from a remote repository that is not his default repo, it
is quite likely that he will pull a new head.  This means that if he tries to
merge or rebase with the other head, he will run into a problem becuase
largefiles has no way of tracking where the remote repository for this other
head is, so it cannot download the largefiles from this other remote repository.
It will attempt to download them from its default remote repository, which will
not yet contain the largefiles.

This patch solves this problem by caching any new largefiles for all heads
directly into the system cache at the time of the pull, so they are available
later.

This behavior is actually more in line with Mercurial's distributed nature,
because pulling already implies we have a connection to the remote server, but
merging or rebasing does not.
2012-01-18 11:33:14 +01:00
Patrick Mezard
b21e9758d9 largefiles: remove unused lfutil.readhash() 2012-01-18 14:33:19 +01:00
Na'Tosha Bard
69b4cf9fd4 largefiles: check if largefile could be found when archiving (issue3193) 2012-01-18 14:19:43 +01:00
Na'Tosha Bard
be9c0ca800 largefiles: refactor lfutil.findfiles to be more logical 2012-01-18 13:41:03 +01:00
Matt Mackall
35e56c3616 merge with stable 2012-01-18 15:07:15 -06:00
Patrick Mezard
2c7c26d633 largefiles: remove empty directories upon update (issue3202) 2012-01-17 11:29:32 +01:00
Na'Tosha Bard
922ddbc57a largefiles: correctly handle newly added largefile on other side of merge 2012-01-16 19:45:35 +01:00
Mads Kiilerich
5c283321a0 rebase: write series file without removed mq patches
Rebase will remove empty changesets and will also completely remove the mq
patch file for rebased empty patches.

Starting with f64ab644b39f (1.9) it would preserve guards by writing the old
series file back. That would however also reintroduce removed patch files in
the series file and the inconsistency would make qpop + qpush fail.

This patch backs out most of f64ab644b39f and makes sure guards are preserved
without reintroducing removed patches.
2012-01-17 02:55:55 +01:00
Christian Ebert
12742c63ce keyword: update filectx.cmp monkeypatch to handle '\1\n' at start of file
Analogous to fe250fe8487d.
2012-01-15 13:37:33 +01:00
Jim Hague
627ffc395e bugzilla: make XMLRPC interface support http and https access
Inadvertently support is currently only for https. For some reason I
thought xmlrpclib.SafeTransport did http and https, but it is https only.

So create http and https XMLRPC transports that retain cookies. Decide which
to use by inspecting the Bugzilla URL.
2012-01-11 16:54:29 +00:00
Steven Brown
51a1bd2f20 rebase: reinstate old-style rev spec support for the source and base (issue3181)
As of 1ffaca626da1 (first released as part of Mercurial 2.0), the rebase command
accepted ONLY revsets for the source and base arguments and no longer accepted
old-style revision specifications. As a result, some revision names were no
longer recognised, e.g.

hg rebase --base br-anch
abort: unknown revision 'br'!

These arguments are now interpreted first as old-style revision specifications,
then as revsets when no matching revision is found. This restores backwards
compatibility with releases prior to 2.0.
2012-01-08 23:09:35 +08:00
Olav Reinert
16da43099e mq: Document that qdel requires exact patch identifiers 2012-01-06 15:05:51 +01:00
Na'Tosha Bard
d2bd6a2acb largefiles: fix output of hg summary (issue3060) 2012-01-08 12:35:47 +01:00
Na'Tosha Bard
0bd0abc6e9 largefiles: fix confusion upon removal of added largefile (issue3176)
This patch makes "hg remove" work the same way on largefiles as it does on
regular Mercurial files.  If you try to remove an added largefile, the removal
fails and you are instead prompted to use "hg forget" to undo the add.
2012-01-08 11:19:51 +01:00
Matt Mackall
f3ededa444 convert: improve exception reporting for SVN logstream
- catch all exceptions
- pickle a stringified version of the exception
- use a normal abort

Hopefully this will result in less mysterious convert exceptions
2011-12-30 15:47:58 -06:00
Matt Mackall
2fc5d7ef51 fetch: fix unneeded commit when no merge attempted (issue2847) 2011-12-30 15:07:05 -06:00
Matt Mackall
02441ac6a9 fetch: patch cornercase in children calculation (issue2773) 2011-12-30 14:31:59 -06:00
Michal Sznajder
1dd342b724 largefiles: clarify help when options are ignored until first add is done 2011-12-28 00:01:48 +01:00
Matt Mackall
c0c746bcbd largefiles: copy files in binary mode (issue3164) 2011-12-20 11:43:38 -06:00
FUJIWARA Katsunori
fe972435d4 i18n: use encoding.lower/upper for encoding aware case folding
this patch uses encoding.lower/upper for case folding, because ones of
str can not fold case of non ascii characters correctly.

to avoid cyclic dependency and to encapsulate logic of normcase in
each platforms, this patch introduces encodinglower/encodingupper in
both posix/windows specific files.

this patch does not change implementation of normcase() in posix.py,
because we do not know the encoding of filenames on POSIX.

some "normcase()" are excluded from function wrap list in
hgext/win32mbcs.py, because they become encoding aware by this patch.
2011-12-16 21:09:41 +09:00
FUJIWARA Katsunori
cfdf6a59f4 windows: use upper() instead of lower() or os.path.normcase()
this patch uses upper() instead of lower() or os.path.normcase() for
case folding on Windows(NTFS), because lower-ing causes problems for
some languages on it.

see below for detail about problem of lower-ing:

    https://blogs.msdn.com/b/michkap/archive/2005/01/16/353873.aspx
2011-12-16 21:09:40 +09:00
Martin Geisler
19be7012dc largefiles: handle merges between normal files and largefiles (issue3084)
The largefiles extension prevents users from adding a normal file
named 'foo' if there is already a largefile with the same name.
However, there was a loop-hole: when merging, it was possible to bring
in a normal file named 'foo' while also having a '.hglf/foo' file.

This patch fixes this by extending the manifest merge to deal with
these kinds of conflicts. If there is a normal file 'foo' in the
working copy, and the other parent brings in a '.hglf/foo' file, then
the user will be prompted to keep the normal file or the largefile.
Likewise for the symmetric case where a normal file is brought in via
the second parent. The prompt looks like this:

  $ hg merge
  foo has been turned into a largefile
  use (l)argefile or keep as (n)ormal file?

After the merge, either the '.hglf/foo' file or the 'foo' file will
have been deleted. This would cause status to return output like:

  $ hg status
  M foo
  R foo

To fix this, the lfiles_repo.status method is changed so that a
removed normal file isn't shown if there is largefile with the same
name, and vice versa for largefiles.
2011-12-09 17:35:00 +01:00
David Soria Parra
900ed6b9a8 progress: check for ui.quiet and ui.debugflag before we write
ui.quiet and ui.debugflag are not initialized during uisetup and
reposetup.  progressui is always initialized, therefore we have to check
during write() if ui.quiet is set or not.
2011-12-14 15:41:08 +01:00
Kevin Gessner
edef96f084 largefiles: don't require a user cache (issue3088) (issue3155)
If the user cache path isn't specified in .hgrc, and it can't be constructed
from the environment, don't try to use that cache.
2011-12-15 13:19:43 -05:00
Martin Geisler
3a9a310829 largefiles: fix 'hg status' abort after merge
If a largefile is introduced on the branch that is merged into the
working copy, then 'hg status' would abort with an error like:

   $ hg status
   abort: .hglf/foo@33fdd332ec: not found in manifest!

The problem was that the largefiles status code only looked in the
first parent for the largefile. Largefiles are now always reported as
modified if they don't exist in the first parent -- this matches the
behavior of localrepo.status for normal files.
2011-12-09 17:34:58 +01:00
Matt Mackall
8985b466e0 merge with stable 2012-01-15 18:00:01 -06: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
Mads Kiilerich
afbab5a2e4 rebase: take locks in the right order
repo.lock was taken before repo.wlock - that could in principle cause a deadlock.
2012-01-13 01:19:07 +01:00
Na'Tosha Bard
5fa005e186 largefiles: correctly download new largefiles when merging
There is a bug in the merge process where, if a new largefile is introduced
in a merge and the user does not have that largefile in his repo's local store
nor in his system cache, the working copy will retain the old largefile.  Upon
the commit of the merge, the standin is re-written to contain the hash of the
old largefile, and the lfdirstate retains a "Modified" status for the file.
The end result is that the largefile can show up in the merge commit as
"Modified", but the standin has no diff.  This is wrong in two ways:

  1) Such a "wedged" history with a nonsense change in a commit should not be
      possible
  2) It effectively reverts a largefile to an old version when doing a merge

This is caused by the fact that the updatelfiles() command always checks the
current largefile's hash against the hash stored in the current node's standin.
This is correct behavior in every case except for a merge.  When merging, we
must assume that the standin in the working copy contains the correct hash,
because the original hg.merge() has already updated it for us.

This patch fixes the issue by patching the repo object to carry a "_ismerging"
attribute, that the updatelfiles() command checks for.  When this attribute is
found, it checks against the working copy's standin, rather than the standin
in the current node.
2012-01-11 16:53:51 +01:00
Levi Bard
d1dde129fb largefiles: remove pasted code
Refactor and remove pasted code from lfcommands.py
2012-01-08 17:46:27 +01:00
Levi Bard
cd1e9ae0e5 largefiles: add error checking to tags conversion (issue3092)
Check for errors when parsing .hgtags during lfconvert,
and skip lines that don't parse or refer to invalid changesets.
2012-01-08 17:06:34 +01:00
Levi Bard
11d6177f07 largefiles: don't reference uninitialized variable (issue3092) 2012-01-08 17:03:39 +01:00
Matt Mackall
0fb748c56c merge with stable 2012-01-09 20:16:57 -06:00
Dan Villiom Podlaski Christiansen
b83792b911 largefiles: factor out a copyalltostore() function 2012-01-08 14:33:10 +01:00
Levi Bard
745707ea8a largefiles: fix inappropriate locking (issue3182)
Don't lock/write on operations that should be readonly (status).
Always lock when writing the lfdirstate (rollback).
Don't write lfdirstate until after committing; state isn't actually changed
until the commit is complete.
2012-01-07 19:05:59 +01:00
Na'Tosha Bard
0bbf2e33ad largefiles: correctly handle dirstate status when rebasing
When rebasing, we need to trust that the standins are always correct. The
rebase operation updates the standins according to the changeset it is
rebasing. We need to make the largefiles in the working copy match.  If we
don't make them match, then they get accidentally reverted, either during
the rebase or during the next commit after the rebase.

This worked previously only becuase we were relying on the behavior that
largefiles with a changed standin, but unchanged contents, never showed up in
the list of modified largefiles.  Unfortunately, pre-commit hooks can get
an incorrect status this way, and it also results in extra execution of code.

The solution is to simply trust the standins when we are about to commit a
rebased changeset, and politely ask updatelfiles() to pull the new contents
down.  In this case, updatelfiles() will also mark any files it has pulled
down as dirty in the lfdirstate so that pre-commit hooks will get correct
status output.
2012-01-07 18:43:34 +01:00
Na'Tosha Bard
05ebae9a13 largefiles: implement addremove (issue3064)
Implementing addremove correctly in largefiles is tricky, becuase the original
addremove function does not call into any of the add or remove function we've
already overridden in the extension.  So the trick is to implement addremove
without duplicating any code.

This patch implements addremove by pulling out the interesting parts of
override_add() and override_remove() into generic utility functions, and
using those to handle the largefiles in addremove.  Then a matcher is
installed that will ignore all largefiles, and the original addremove
function is called to take care of the regular files in addremove.

A small bit of monkey patching is used to make sure that remove_largefiles()
notifies the user when a file is removed by addremove and also makes sure
the removal of largefiles doesn't interfer with the original addremove's
operation of removing the standin.
2012-01-07 12:42:54 +01:00
Martin Geisler
ba8731035e Use explicit integer division
Found by running the test suite with the -3 flag to show places where
we have int / int division that can be replaced with int // int.
2012-01-08 18:15:54 +01:00
Martin Geisler
fa50c1a5a0 cvsps: pull function definition out of loop 2012-01-08 17:57:25 +01:00
Levi Bard
68127050e4 largefiles: Fix parser warning: redefinition of unused 'node' from line 14 2012-01-08 11:23:21 +01:00