Jean-Luc Nacif Coelho
Jean-Luc Nacif Coelho

Reputation: 1022

Pulling without merging

I'm trying to make a crontab that pulls and makes a repository every day for me, but whenever i do that and the repository merges the crontab gets stuck. Is there a way to pull without prompting a merge and without deleting my code?

Upvotes: 0

Views: 147

Answers (2)

Ti Strga
Ti Strga

Reputation: 1390

Is there a way to pull without prompting a merge

Just hg pull by itself does not merge, nor does it ask the user for anything. The local repository will be added to, but the local working directory will not be touched. Nothing will be deleted.

If your .hgrc file is using a [defaults] section, you might be silently adding the -u/--update option without realizing it. That option tries to automatically do an update. If that's the case, then don't use defaults sections.

If this doesn't answer your question, then show us exactly what commands your cron entry is running, what the output is, where it "gets stuck" (is SSH asking for authentication credentials?), and which part you're trying to avoid.

Upvotes: 1

Ry4an Brase
Ry4an Brase

Reputation: 78330

The literal answer to how do you pull without merging is you hg fetch which gets the new remote changesets but doesn't update any files in your working directory. It sounds like what you're really asking though is "how do I update to tip and throw away any local changes?". If that's what you're going for you'd do:

hg fetch # gets new changesets
hg update --clean  # update to latest files THROWING AWAY LOCAL CHANGES

Is that what you're going for?

Upvotes: 0

Related Questions