Newbie struggles trying to import an existing project
Kevin Smith
yarcs at qualitycode.com
Wed Jun 1 12:01:10 UTC 2005
Matt Mackall wrote:
> On Tue, May 31, 2005 at 10:22:50PM -0400, Kevin Smith wrote:
>
>>Now I want to add one directory at a time, but that doesn't work. hg
>>status reports the directory with an R flag (what does "R" mean?), and
>>still lists all the files within that directory as "?".
>
> Why would you want to add one directory at a time?
Mostly to try to get my .hgignore right. I wanted to try adding a
directory, then see if it had included any files I didn't want. Baby steps.
> Mercurial doesn't know much about directories yet. R means it thinks
> the directory is removed since it's looking for a file with the same
> name.
Oh. At a minimum, it should reject an 'add' for any file that doesn't
exist. Which would also fix this:
>>I tried hg commit, and it said there was nothing to do. hg add doesn't
>>seem to have a "recursive" flag. Finally, I gave in and did an hg
>>addremove followed by hg commit, at which point I got bitten by my
>>earlier hg add --help which shows up in hg status:
>
>
> Doh!
> The easy way is to nuke your .hg directory. There's currently no
> concept of 'unadding' something. Anyone have suggestions on the right
> interface for this?
If it only added entries that really existed, then there might not be a
need for it. That would be if the rule is: "if it's in the directory,
and not in .hgignore, it *will* be added to the repo". Some folks will
hate that rule, but I'm ok with it. In that case, the addremove command
wouldn't even be needed, because it would be automatic.
If you are going to allow the user to manually exclude files, then I
think you do need a "remove" or "untrack" command. It would work on
files that have been added but not committed, and on files that have
already been committed.
Either way, eventually it might be nice to have a systemwide default-ish
.hgignore for things like .o and .zip, but to be able to override it on
a per-repo basis to either include specific objects, or exclude
additional files. Otherwise the "basics" have to be copied into every
.hgignore, and I hate having ten copies of the same data. "Don't Repeat
Yourself". "Once and Only Once".
>>Oh, and the commit just sat there for several seconds, so I actually
>>started entering a commit comment thinking it was waiting for stdin.
>>Some kind of "working..." message would be helpful there, since this was
>>a relatively small tree I was trying to check in.
>
> Hmm. It shouldn't just sit there. It should be nearly instantaneous.
Ok, so the tree is only small relative to bigger trees. It contains 75
megs of data. I forgot that it has a copy of Sun's JVM (40 megs), for
example. Still, that's not enormous.
Kevin
More information about the Mercurial
mailing list