Commit Graph

8112 Commits

Author SHA1 Message Date
Mads Kiilerich
82bc04a832 forget: use forward slashes for internal paths
forget into a subrepo failed on windows because pathes were joined with \.
2011-11-15 02:44:55 +01:00
Matt Mackall
66de5cde16 merge: give a special message for internal:merge failure (issue3105) 2011-11-16 18:04:19 -06:00
Kevin Bullock
8db1185fdd bookmark: remove excess creation of changectx's 2011-08-17 08:55:01 -05:00
Kevin Bullock
9fce7fc5a8 bookmark: same order for options and code 2011-08-17 08:49:40 -05:00
Matt Mackall
3a9838cebc merge with stable 2011-11-15 14:33:06 -06:00
Matt Mackall
3eab62750e dirstate: fix case-folding identity for traditional Unix
We used to use os.path.normcase which was a no-op, which was unhelpful
for cases like VFAT on Linux.
2011-11-15 14:25:11 -06:00
Pierre-Yves David
e719727169 phases: set common changeset to public on pull 2011-11-11 00:22:02 +01:00
Pierre-Yves David
bf6f3ef1a7 phases: mark content pushed as public in local repo on push 2011-11-11 00:21:17 +01:00
Pierre-Yves David
493771f789 phases: marked content of a changegroup as published 2011-11-11 00:19:00 +01:00
Pierre-Yves David
0f1186823a phases: set new commit in 1-phase 2011-11-11 00:15:22 +01:00
Pierre-Yves David
c97518dfab phases: add retractboundary function to move boundary backward
The advanceboundary documentation is updated to highlight the difference.
2011-11-11 00:16:53 +01:00
Pierre-Yves David
241fc82f4e phases: rename moveboundary into advance boundary
This rename prepare the creation of retract boundaru that move boundary backward
2011-11-10 01:09:15 +01:00
Pierre-Yves David
1401cbb897 phases: remove underbar into target_phase argument 2011-11-10 01:08:08 +01:00
David M. Carr
f9ef6cf73b forget: support forgetting explicit paths in subrepos
Change the behavior of the forget command such that explicit paths in
subrepos are handled by forgetting the file in the subrepo. This eliminates the
previous behavior where if you called "hg forget" for an explicit path in a
subrepo, it would state that the file is already untracked.
2011-11-09 19:46:51 -05:00
Matt Mackall
8f2b7260c4 merge with stable 2011-11-10 11:00:27 -06:00
Stefano Tortarolo
a179a7e151 graft: mark a string for translation 2011-11-08 21:31:39 +01:00
Nicolas Venegas
2582d1e3d9 mdiff/patch: fix bad hunk handling for unified diffs with zero context
Prior to this patch "hg diff -U0", i.e., zero lines of context, would
output hunk headers with a start line one greater than what GNU patch
and git output. Guido van Rossum documents the unified diff format[1]
as having a start line value "one lower than one would expect" for
zero length hunks.

Comparing the behaviour of the three systems prior to this patch in
transforming

  c1
  c3

to

  c1
  c2
  c3

- GNU "diff -U0" reports the hunk as "@@ -1,0 +2 @@"
- "git diff -U0" reports the hunk as "@@ -1,0 +2 @@"
- "hg diff -U0" reports the hunk as "@@ -2,0 +2,1 @@"

After this patch, "hg diff -U0" reports "@@ -1,0 +2,1 @@".

Since "hg export --config diff.unified=0" outputs zero-context unified
diffs, "hg import" has also been updated to account for start lines
one less than expected for zero length hunk ranges.

[1]: http://www.artima.com/weblogs/viewpost.jsp?thread=164293
2011-11-09 16:55:59 -08:00
Martin Geisler
3d4a8c449c merge with main 2011-11-04 10:31:38 +01:00
David M. Carr
b8f899bd68 subrepo: improve help for svn subrepo support
Add details on which commands are supported for Subversion subrepos.
2011-11-03 23:12:31 -04:00
David M. Carr
6878ff4146 subrepo: improve help for git subrepo support
Add details on which commands are supported for git subrepos.
2011-11-03 23:12:30 -04:00
David M. Carr
4025aa1003 subrepo: update help for commit to reflect new default behavior
Update the subrepo help to be consistent with the new default behavior,
which is to abort if any subrepo is dirty.
2011-11-03 23:11:40 -04:00
Matt Mackall
864ce9da04 misc: adding missing file close() calls
Spotted by Victor Stinner <victor.stinner@haypocalc.com>
2011-11-03 11:24:55 -05:00
Matt Mackall
e576cf8a52 dirstate: don't fail when dropping a not-tracked file (issue3080)
Complex merges with divergent renames can cause a file to be 'moved'
twice, causing dirstate.drop() to be called twice. Rather than try to
ensure there are no unexpected corner cases where this can happen, we
simply ignore drops of files that aren't tracked.
2011-11-01 15:19:37 -05:00
FUJIWARA Katsunori
f6b7a91d98 minirst: use unicode string as intermediate form for replacement
# this change redones part of e0051068893a, backed out by 38c00c035629

Some character encodings use ASCII characters other than
control/alphabet/digit as a part of multi-bytes characters, so direct
replacing with such characters on strings in local encoding causes
invalid byte sequences.

[mpm: test changed to simple doctest]
2011-10-31 21:06:18 +09:00
Matt Mackall
9580de9b45 util: add a doctest for empty sha() calls 2011-10-31 15:41:39 -05:00
Matt Mackall
bbf72a4e6e util: allow sha1() with no args
Normally this works because we replace util.sha1 with hashlib.sha1
after first use, but if the first user doesn't provide an arg, it
breaks.
2011-10-31 14:22:11 -05:00
Matt Mackall
7215130ac4 strip: backout 9aac86f54486 (issue3077) 2011-10-30 12:10:09 -05:00
Matt Mackall
b066b57e3c backout 17bc9a6bb165 (issue3077) (issue3071)
Using util.realpath turns out to create complex issues on both Mac and
Windows. Back this change out for the release.
2011-10-29 11:02:23 -05:00
Brodie Rao
aabbd72d18 hgweb: fix dynamic date calculation not working under Safari
While Chrome, Firefox, and IE 6+ support the current date format being
passed to Date(), Safari doesn't:

> new Date('Mon Oct 24 13:58:01 2011 +0200')
  Invalid Date

However, the rfc822date format--officially supported by
ECMAScript[1]--does work:

> new Date('Mon, 24 Oct 2011 13:58:01 +0200')
  Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)

This change replaces all instances of {date|date} in HTML with
{date|rfc822date}. For elements that only have the "age" class,
there's no outward change for users with JavaScript enabled. For
elements with both the "age" and "date" classes, the full date
displayed uses the new format.

Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1.

[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
2011-10-27 11:57:08 -07:00
Peer Stritzinger
ed0c1f398e revert: fix missing removes when parent was changed in dirstate
When dirstate parent is changed with dirstate.setparent before a
revert so it no longer points to where the dirstate refered to, revert
does not remove all files it should:

Revert to a different revision needs also to remove files that are not
found through disptables and not in the context or parent manifest.
2011-10-26 18:47:12 +02:00
Patrick Mezard
1e1f58f358 diffstat: be more picky when marking file as 'binary' (issue2816)
The 'Bin' marker was added to every changed file for which we could not find
any diff changes. This included binary files but also copy/renames and mode
changes. Since Mercurial regular diff format emits a 'Binary file XXX has
changed' line when fed with binary files, we use that and the usual git marker
to tell them from other cases. In particular, new empty files are no longer
reported as binary.

Still, this fix is not complete since copy/renames/mode changes are now
reported as '0' lines changes, instead of 'Bin'.
2011-10-24 13:41:19 +02:00
Matt Mackall
b7f097bf54 graft: fix duplicate filter logic 2011-10-24 16:57:14 -05:00
Matt Mackall
0d1e03e15b graft: fix duplicate scan message 2011-10-24 16:57:14 -05:00
Matt Mackall
226e1ff7c0 util: don't complain about '..' in path components not working on Windows 2011-10-24 16:57:14 -05:00
Matt Mackall
11a871ed47 graft: fix formatting of message 2011-10-24 12:09:12 -05:00
Thomas Arendsen Hein
51c498ead0 consistency: use util.realpath instead of os.path.realpath where useful
exceptions:
  hg: os.path.realpath used before util can be imported
  tests/run-tests.py: may not import mercurial modules
2011-10-24 13:51:24 +02:00
Thomas Arendsen Hein
f4c6197057 posix: workaround for os.path.realpath bug in Python 2.4.1 and before
os.path.realpath didn't resolve symlinks that were the first component of
the path, see http://bugs.python.org/issue1213894
2011-10-24 13:32:23 +02:00
Matt Mackall
788df2a72b windows: sanity-check symlink placeholders
On Windows, we store symlinks as plain files with the link contents.
Via user error or NFS/Samba assistance, these files often end up with
'normal' file contents. Committing these changes thus gives an
invalid symlink that can't be checked out on Unix.

Here we filter out any modified symlink placeholders that look
suspicious when computing status:

- more than 1K (looks more like a normal file)
- contain NULs (not allowed on Unix, probably a binary)
- contains \n (filenames can't contain \n, very unusual for symlinks,
  very common for files)
2011-10-23 16:32:27 -05:00
Matt Mackall
3044265f69 windows: recompute flags when committing a merge (issue1802)
Before this patch, Windows always did the wrong thing with exec bits
when committing a merge: consult the flags in first parent.

Now we manually recompute the result of merging flags at commit time,
which almost always does the right thing (except when there are
conflicts between symlink and exec flags).

To do this, we:

- pull flag synthesis out into its own function
- delay building this function unless it's needed
- add a merge case that compares flags in local and other against the ancestor

This has been tested in multiple ways on Linux:

- running the whole test suite with both old and new code in place,
  checking for differences in each flags() result
- running the whole test suite while comparing real on-disk flags
  against synthetic ones for merges
- test-issue1802 (from Martin Geisler) which disables exec bit
  checking on Unix
2011-10-22 16:12:33 -05:00
Kevin Bullock
dd00f9e122 import: abort usefully if no patch name given 2011-10-21 11:10:43 -05:00
Pierre-Yves David
4d3328f835 revset: disambiguous the node variable
The module could be confused with the function.
2011-10-21 14:15:58 +02:00
Matt Mackall
01c8789013 revset: deal with empty lists in formatspec 2011-10-21 12:12:21 -05:00
Martin Geisler
acfa971cf1 subrepos: abort commit by default if a subrepo is dirty (BC)
This changeset flips the default value of ui.commitsubrepos setting
from True to False and adds a --subrepos flag to commit.

The commit, status, and diff commands behave like this with regard to
recusion and the ui.commitsubrepos setting:

          | recurses      | recurses
          | by default    | with --subrepos
  --------+---------------+----------------
  commit: | commitsubrepo | True
  status: | False         | True
  diff:   | False         | True

By changing the default from True to False, the table becomes
consistent in the two columns:

* without --subrepos on the command line, commit will abort if a
  subrepo is dirty and status/diff wont show changes inside subrepos.

* with --subrepos, all three commands will recurse.

A --subrepos flag on the command line overrides the config settin.g
2011-10-21 00:33:08 +02:00
Wagner Bruna
7a521d704e bisect: add i18n contexts 2011-10-18 09:38:14 -02:00
Wagner Bruna
d4e8e13b0d import: add i18n context 2011-10-18 09:38:10 -02:00
Mads Kiilerich
06d30b903b grep: correct handling of matching lines without line ending (issue3050)
Matching lines without trailing '\n' was missing the last character.

That seems to have been an unintended side effect of 8abe3f27975c.
The test in c21748e4cd4d documents the bad behaviour.
2011-10-16 01:26:06 +02:00
Pierre-Yves David
88aa929fad discovery: Fix error print mentioning a 'None' branch
When talking to old server discovery use heads of the 'None' branch to refer to
topological heads. This use of None should never make it to the end user.
2011-10-17 11:37:59 +02:00
Matt Mackall
9dea83bdb8 auth: fix realm handling with Python < 2.4.3 (issue2739) 2011-10-17 13:42:42 -05:00
Martin Geisler
c49aaff90e subrepo: abort in hgsubrepo._get if the destination is obstructed
Before, we deleted foo when we determined that there were zero
changesets in the foo subrepo. Any files in foo was deleted too. We
now delete foo/.hg instead, and the normal checks in hg.clone will
then abort if there are untracked files in foo.
2011-10-17 18:01:38 +02:00
Martin Geisler
ebc547d4c7 subrepo: pull revisions on demand when archiving hg subrepos
Before, running 'hg archive -S' could result in

 abort: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'!

if a subrepo was missing completely or had missing changesets. Now,
the missing changesets will be pulled or cloned as appropriate.

This make Mercurial subrepos match Git subrepos which already took
care to fetch any missing commits before starting the archive.
2011-10-17 16:45:19 +02:00