Commit Graph

203 Commits

Author SHA1 Message Date
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
Eric Roshan Eisner
070c37b77f subrepo: fix git branch tracking logic (issue2920) 2011-10-11 21:34:55 -07:00
Matt Mackall
871da8c4a2 merge with stable 2011-10-07 17:22:12 -05:00
Matt Mackall
f407e6b85d subrepo: fix repo relative path calculation for root directories (issue3033) 2011-10-02 16:41:07 -05:00
Matt Mackall
55e59c2f85 subrepo: improve error message when svn isn't found
subprocess was returning the following unhelpful message:

 abort: No such file or directory
2011-10-02 13:02:15 -05:00
Mads Kiilerich
a9383c13c5 subrepo: fix cloning of repos from urls without slash after host (issue2970)
This fixes a regression introduced with the new url handling in 1.9.

This should perhaps be fixed in the url class instead, but that might be too
invasive for a stable bugfix.
2011-08-26 16:23:35 +02:00
Vasily Titskiy
a8f0b7449a subrepo: handle adding svn subrepo with a svn:external file in it (issue2931) 2011-07-28 13:28:32 -04:00
Kevin Bullock
e4deb92563 subrepo: don't commit in subrepo if it's clean
If a subrepo has changed relative to the outer repo's substate, but the
subrepo itself is clean, we don't need to commit in the subrepo.
2011-07-19 13:43:53 -05:00
Eli Carter
8827c54a9a subrepo: correct revision in svn checkout
A Subversion subrepo checkout uses a url and --revision which does not do the
correct thing when specifying a revision of a branch that has since been
deleted and recreated.  The checkout needs to specify the revision as URL@REV
instead.
2011-06-30 13:22:12 -05:00
Matt Mackall
8e3367eb55 subrepos: be smarter about what's an absolute path (issue2808) 2011-06-29 16:01:06 -05:00
Augie Fackler
e777b9d80a svn subrepos: work around checkout obstructions (issue2752)
We do this by ensuring the working copy is clean and then blowing away
the working copy and replacing it with one from the desired path. We
could probably use 'svn switch' to do this more efficiently, but
there's some subtle logic required to get that right and this is
more likely to work reliably.
2011-06-17 15:22:50 -05:00
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05:00
Peter Arrenbrecht
d836ee3cea hg: add opts argument to clone for internal remoteui 2011-06-08 18:24:33 +02:00
Augie Fackler
2578f4f9f2 subrepo: make stdin for svn a pipe for non-interactive use (issue2759)
This certainly can't hurt, so go ahead and do it, potentially along
with --non-interactive if that flag is safe for the given subcommand.
2011-05-31 19:49:17 -05:00
Regis Desgroppes
422cfa6bde subrepo: svn abort now depends on exit code (issue2833) 2011-05-31 16:22:04 -05:00
Matt Mackall
e5b463de99 merge with stable 2011-05-31 15:28:23 -05:00
Eric Eisner
55bac452e8 subrepo: don't crash when git .hgsubstate is empty (issue2716) 2011-05-28 11:03:48 -04:00
Martin Geisler
2edabc4530 subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
Paul Molodowitch
dfc345d9b5 subrepo: bare git repos considered dirty
Currently, if there is a bare git subrepo, but it is at the "right"
revision, calling dirty() will error because diff-index does not work
on bare repos. This patch makes it so bare subrepos are always
considered dirty.
2011-05-25 08:38:58 -07:00
Matt Mackall
db4e14bfa3 subrepo: handle local added subrepo case correctly 2011-05-23 22:49:10 -05:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Matt Mackall
8acd26be3c subrepo: use a safer revision check for hg repos
This avoids a traceback if the expected revision has been stripped.
2011-05-12 18:35:04 -05:00
Thomas Arendsen Hein
394d9f50d7 subrepo: use code from 1d866b621bf7 only if Python needs it (issue2795)
With Python >= 2.6 the original code already works correct, therefore the
fix for issue2556 on Python <= 2.5 broke relative subrepositories with
newer versions of Python.
2011-05-05 16:01:09 +02:00
Patrick Mezard
3616aca56a subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant and only works with svn >= 1.5 but the only
alternative I can think of is to write our own purge command for subversion.
2011-03-04 14:00:49 +01:00
Augie Fackler
a74cb339b1 subrepo: tell Subversion when we are non-interactive (issue2759)
$ hg clone repo repo-clone -v
  updating to branch default
  resolving manifests
  getting .hgsub
  getting .hgsubstate
  abort: svn: OPTIONS of 'https://subversion.srv/project': Server certificate
  verification failed: issuer is not trusted (https://subversion.srv)
2011-04-29 03:05:48 -05:00
Thomas Arendsen Hein
e97f821988 subrepo: prevent url normalization from removing // in ssh paths (issue2556) 2011-04-07 12:33:47 +02:00
Eric Eisner
3cc72a297f subrepo: recognize scp-style paths as git URLs 2011-03-17 16:29:09 -04:00
Patrick Mezard
cb64444c5f subrepo: backout 66e642f0195f, --force requires svn >= 1.5 2011-03-07 23:02:04 +01:00
Eric Eisner
25b04beb36 subrepo: don't crash when git repo is missing 2011-03-07 12:03:54 -05:00
Patrick Mezard
12049011b2 subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant but it is much simpler than rewriting our own
purge command for subversion.
2011-03-04 14:00:49 +01:00
Eric Eisner
52f3c93dfa subrepo: only attempt pulling from git's origin
git fetch does not accept repository URLs as arguments, and the intended
logic of this code was not actually doing anything.
2011-02-23 10:59:36 -05:00
Eric Eisner
fc76e4918d subrepo: disallow all unknown git ref types 2011-02-23 10:17:44 -05:00
Eric Eisner
16fbbf312c subrepo: expand relative sources for git subrepos 2011-02-22 15:11:10 -05:00
Martin Geisler
d9e6fe01b4 subrepo: break long line found by check-code 2011-02-17 09:20:44 +01:00
Kevin Bullock
720b543cad subrepos: print short git changeset ids
This changes the prompts on git subrepos to show only the first seven
digits of git changeset IDs (as git's command line does):

    $ hg update
    subrepository sources for s differ (in checked out version)
    use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
2011-02-16 11:53:48 -06:00
Erik Zielke
1d125c0477 subrepos: prompt on conflicts on update with dirty subrepos
Consider a repository with a single subrepository. The changesets in
the main repository reference the subrepository changesets like this:

  m0 -> s0
  m1 -> s1
  m2 -> s2

Starting from a state (m1, s0), doing 'hg update m2' in the main
repository will yield a conflict: the subrepo is at revision s0 but
the target revision says it should be at revision s2.

Before this change, Mercurial would do (m1, s0) -> (m2, s2) and thus
ignore the conflict between the working copy and the target revision.

With this change, the user is prompted to resolve the conflict by
choosing which revision he wants. This is consistent with 'hg merge',
which also prompts the user when it detects conflicts in the merged
.hgsubstate files.

The prompt looks like this:

  $ hg update tip
   subrepository sources for my-subrepo differ
  use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
2011-02-09 10:53:09 +01:00
Erik Zielke
2017770368 subrepo: remove argument introduced by mistake in e3640daa4703 2011-02-09 13:37:21 +01:00
Patrick Mezard
15ac0306ee Merge with stable 2011-02-01 21:59:07 +01:00
Patrick Mezard
339c6194d0 subrepo: fix update -C with svn subrepos when cwd != repo.root 2011-02-01 21:39:28 +01:00
Erik Zielke
bf9e13d063 subrepo: make update -C clean the working directory for svn subrepos
This makes 'hg update --clean' behave the same way for both kinds of
subrepositories. Before Subversion subrepos did not take the clean
parameter into account, but just updated to the given revision and
merged uncommitted changes into that.
2011-01-31 13:33:41 +01:00
Patrick Mezard
afb494e2e2 subrepo: compare svn subrepo state to last committed revision
A subversion project revisions are a subset of the repository revisions, you
can ask subversion to update a working directory from one revision to another
without changing anything. Unfortunately, Mercurial will think the
subrepository has changed and will commit it again. To avoid useless commits,
we compare the subrepository state to its actual "parent" revision. To ensure
ascending compatibility with existing subrepositories which might reference
fake revisions, we also keep comparing with the subrepo working directory
revision.

NOTE: not sure if this should go in stable or not.
2011-01-22 16:15:40 +01:00
Kevin Bullock
356b5c3414 subrepo: clarify comments in dirty() methods
Just a little change to bring the comments in the dirty() methods of the
various subrepo classes into a uniform structure. This clarifies the
meaning of the states checked.
2011-01-04 10:42:00 -06:00
Erik Zielke
68282c3062 subrepo: make update -C clean the working directory for git subrepos
This makes 'hg update --clean' behave the same way for all three kinds
of subrepositories [hg, svn, git]. Before git subrepos did not take
the clean parameter into account, but just updated to the given
revision and merged uncommitted changes into that.
2011-01-31 13:40:05 +01:00
Martin Geisler
17df79113a merge with stable 2011-01-31 13:38:00 +01:00
Patrick Mezard
276b88543c Merge with stable 2011-01-22 16:29:10 +01:00
Kevin Bullock
e69254e948 subrepo: fix svnsubrepo.dirty() checking of ignoreupdate (issue2499)
The ignoreupdate flag to subrepo.dirty(), introduced in 55e4073493fc, is
correctly checked with this change.
2011-01-04 11:33:47 -06:00
Matt Mackall
eec34ddf7c subrepo: backed out changeset 9ce26f91f137 2010-12-10 19:08:17 -06:00
Mads Kiilerich
9933c7a60f subrepo: initialize subrepo relative default paths relative to their root 2010-12-10 01:30:16 +01:00
Eric Eisner
5a68596380 subrepo: basic support for status of git subrepos 2010-12-20 13:59:33 -05:00
Eric Eisner
ca54cd3a42 subrepo: fix subrelpath for git subrepos
This patch conforms gitsubrepo code to the variable naming scheme of the other
subrepo implementations. All user-facing path references should be relative
to the root repository.
2010-12-20 13:59:33 -05:00