How do I supply my password to Bazaar so it can fetch my code from my remote server? - version-control

I have a codebase on a remote Linux server (in my private home directory). I am traveling and my internet connection is spotty, so I'd like to download the code locally, work on it, and then push changes to the server. Since I'm already managing the codebase with Bazaar, seems like that's the logical tool to use for this task as well. I downloaded Bazaar for Windows, and tried creating a branch, but can't figure out what location to enter in the "From" field. My first guess was to do it the way I do with scp, where I enter:
username#host.com/subfolder-with-code
But that didn't work. Also, where do I enter my password?

I think you just needed to add the protocol to that your url:
bzr branch bzr+ssh://username#host.com/subfolder-with-code
should do the trick.
See bzr help urlspec for more info.

Related

Use Git list output to copy files for archiving

I'm currently helping to maintain a project for a client remotely. I'm the only developer ergo some of my unorthodox approaches/thinking.
the problem
The client is using Visual Studio 2010 + Team Foundation Server for their source control. I am working on a Mac over VPN and have tried several approaches to make committing to their TFS workable. I've tried TFS plugin for Eclipse with no luck (VPN really hoses the connection to TFS). Currently I am having to do a full "checkout for edit" through a virtual machine to the TFS, then transferring the project over the VPN to overwrite those files. Not a sustainable solution to say the least.
the solution?
I'm wondering if there is a way to:
get a list of changed files from GIT (I think this is the solution
(How to list all the files in a commit?)
then use that list as a means to go in and fetch those file, maintaining their folder structure
from there I can do my dump over
VPN into the VM that has the project mapped in TFS.
Or if there is something I've overlooked or hadn't thought of, please do recommend them, I'm all ears.
First, I'm assuming you are running the VM on or near the TFS server, not on your Mac. If not, you can just share a directory using VMware/VirtualBox and edit away on your Mac...
It sounds like you could achieve what you want with plain old Git. If you:
Create a bare repository on the VM (git init --bare)
Add a post-receive hook to copy the files from the master branch (for example) into the TFS directory, overwriting merrily (http://git-scm.com/book/en/Customizing-Git-Git-Hooks)
Initialise your local copy of the source as a Git repository (git init)
Add the remote repository. Assuming it's a Windows box you can use an SMB shared folder over the VPN so your remote is "local" as far as Git is concerned. (git remote add tfsserver file:///Volumes/tfsmount/code
Your first push will be expensive (but you could prepopulate the remote repo to get around that), but subsequent pushes would be just the changesets. The post-receive hook would then take care of updating the files, and you're laughing.
Of course, you then get to impress them with how amazing Git is, get them to migrate, and your problem goes away forever :).
Update: Here's a link which describes these steps in more detail, under the guise of updating a remote website: http://toroid.org/ams/git-website-howto.

Configuring Mercurial's built-in server

I'm trying to get an install of Mercurial setup at work to evaluate it with our legacy code. The "server" I'm currently using is simply a desktop running Windows XP with SP3 on our intranet. The "client" install is on my local desktop, also running Windows XP with SP3. (I'm also using TortoiseHG on both machines.)
The web server is running at http://localhost:8000, and I can view the repository in a browser. But, when I try to detect outgoing changes to the repo, I get an HTTP 404 error. I can see the request show up in the server's log, so I'm pointing to the right location, but it shows GET http://host:8000/reponame?cmd=capabilities HTTP/1.1 404. No matter what settings I change, I can't seem to get the client to successfully execute a command against the repo. Does anyone have an idea why this wouldn't be working?
I have a similar setup, and I had similar problems.
I use the following command to run my HG serve (it's in a batch file):
hg.exe serve --prefix mercurial --address 123.12.1.1 --port 8008 --web-conf hg-web.conf --accesslog hg-access.log --errorlog hg-error.log
In the hg-web.conf I have:
[web]
style = default
allow_push = *
push_ssl = false
[paths]
my-repo = c:\hg\my-repo
With this setup, I can access my repository by accessing url http://ip:port/mercurial/my-repo
I can push without a problem.
Try this setup and I hope it helps you resolve your problem.
Well, when I start internal server in my TortoiseHG (for single repo, Repostory - Start Web-server from Workbench main menu)
Server window tells 'Running on localhost:8000', but really server listens on all interfaces (netstat -na shows TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING)
On clone-edit-commit in fork and testing outgoing (from THG directly) I see
% hg --repository Z:\clone outgoing http://10.1.14.94:8000/
comparing with http://10.1.14.94:8000/
searching for changes
changeset: 39:c57a9357ec55
tag: tip
user: I
date: Fri Mar 08 17:00:05 2013 +0600
summary: Test-change
Some times ago I also pulled|pushed from|to these Mercurial repos from my another host. Server config is trivial and all was done inside TortoiseHG settings.
My [web] section in mercurial.ini (and nothing more)
[web]
port = 8000
encoding = UTF-8
allow_archive = bz2, gz, zip
style = gitweb
(push disabled now, work in pull-only mode)
PS: TortoiseHg version 2.7.1 on Windows XP SP3
Push means to move a changeset from one repo to another. You haven't stated that you made two separate clones of the repo, then try to push from A to B. So let's assume you're confused here, and talk about that confusion: Imagine I try to push from my own repo to an hg serve instance running against my own repo. That's like trying to phone myself to tell myself something.
Secondly, if you're really trying to push from A to B, and there really are changes in A that need to get to B, then, your actual problem is probably that you haven't got the URL of the repository input correctly into your GUI tool, which is Tortoise HG, I assume. Try it again from the command line while you're learning. If you get an error post the error here: hg push http://myserver:8000
The first time I tried Mercurial, after a long history of using Subversion, I had come to think I needed a "server" component more than I actually did. In subversion the server is where commits happen. IN mercurial, commits happen locally, and when you push to the remote (perhaps central) server, then the other people on your team see your changes. This is the big difference. I asssume you're trying to push, because commits happen locally. If you're confused about the difference between a commit and a push, then I suggest you look at http://hginit.com/
As far as setting up a server, there are three fairly easy options I can recommend:
"hg serve" from the commandline, as shown by other answers. Easy, and for temporary use only. Perfect for learning.
Install Mercurial inside Apache (easier than installing Mercurial inside IIS) for a permanent web-server with full authentication and perhaps encryption. If you use hgwebdir instructions on the Mercurial wiki it should take you about an hour. If you use the pre-built solutions, it should take much less time. I used Bitnami's pre-built solutions for windows and got one up in 5 minutes recently. Bitnami makes available installers that will get python, apache, mercurial, and other stuff, all installed and working together in what they call a "stack" (bunch o stuff that already works).
Here's the really brilliant solution. Use the free private web repositories at BitBucket.org. Free for public (open source) and private (small teams and personal) use, and quite cheap for large teams. Admin effort for you? No more than logging into a website. And you're done.

Host Git Repo on my Mac for Xcode project

For work all my code must be hosted locally, which rules out using something nice like GitHub. However, I really want to be able to use XCodes Git functionality.
Is it possible to host the repository locally and have multiple computers push and pull from it? I have a server available but it runs Windows 08 so I'm not real keen to making that work
Any *nix machine that runs a SSH server can easily host a Git repo with push/pull access. All someone needs to be able to do is log in and reach the files, and they can clone and pull. Write access, and they can push. (You're going to want a bare repo if you want it to accept pushes, though. Otherwise, things get all kinds of wonky. Less error-prone would be to provide a way for people request that you pull from their repo, but that requires that each person host a Git repo. If that's not really an option, then next best would be to let everybody push to a bare repo.)
Git will also work over HTTP, and it's allegedly easy to set up Apache to host a repo. I've actually had a lot of success with SSH, though. It seems even easier to set up to me; all the server needs is an sshd, (almost certainly) Git, and appropriate user accounts.
Also note, if you don't need to share, then Git already does everything you need on its own, offline. All the above stuff only applies if you want other people to be able to pull from (and possibly push to) you.
You can run git or svn right on your machine. Just set up a local repository. Note that mac os x has unix under the hood.

Drupal 6: using bitbucket.org for my Drupal projects as a real version control system dummy

Here is a real version control system dummy! proper new starter!
The way I have worked so far:
I have a Drupal-6 web project www.blabla.com and making development under www.blabla.com/beta . I'm directly working on blabla.com/beta on server. nothing at my local, nothing at anywhere else. Only taking backup to local, time to time. I know horrible and not safe way :/
The new way I want to work from now on:
I decided to use Mercurial. I have one more developer to work on same project with me. I have a blabla.com Drupal-6 project on bluehost and making development blabla.com/beta. I found out http://bitbucket.org/ for mercurial hosting. I have created an account.
So now how do I set up things? I'm totally confused after reading tens of article :/
bitbucket is only for hosting revised files? so if I or my developer friend edit index.php, bitbucket will host only index.php?
from now on do I have to work at localhost and upload the changes to blueshost? no more editing directly at blabla.com/beta? or can I still work on bluehost maybe under blabla.com/beta2?
When I need to edit any file, do I first download update from bitbucket, I make my change at localhost, update bitbucket for edited files, and uploading to bluehost?
Sorry for silly questions, I really need a guidance...
Appreciate helps so much! thanks a lot!
bitbucket is only for hosting revised files?
The main service of bitbucket is to host files under revision control, but there is also a way to store arbitrary files there.
so if I or my developer friend edit index.php, bitbucket will host only index.php?
I a typical project every file which belongs to the product is cheked into revision control, not only index.php. see this example
from now on do I have to work at localhost and upload the changes to blueshost? no more editing directly at blabla.com/beta? or can I still work on bluehost maybe under blabla.com/beta2?
Mercurial does not dictate a fix workflow. But I recommend that you have mercurial installed where you edit the files. For example then you can see direct which changes you did since the last commit, without to need to copy the files from your server to your local repository.
I absolutely recommend a workflow where somewhere in the repository is a script which generates the archive file which is transmitted to the server, containing the revision of the repository when the archive got created. This revision information should also be somewhere stored on the server (not necessarily in a public accessible area), since this information can get very handy when something went wrong.
When I need to edit any file, do I first download update from bitbucket, I make my change at localhost, update bitbucket for edited files, and uploading to bluehost?
There are several different approaches to get the data to the server:
export the local repo into an archive and transmit this onto the server (hg archive production.tar.bz2), this is the most secure variant, since it does not depend on any extra software on the server. Also depending on how big the archive is this approach can waste lots of bandwidth.
work on the server and copy changed files back, but I don't recommend this since is is very easy to miss something important
install mercurial on the server, work in a working copy there and hg export locally there into the production area
install mercurial on the server and hg fetch from bitbucket(or any other server-accessible repository)
install mercurial on the server and hg push from your local working copy to the server (and hg update on the server afterwards)
The last two points can expose the repository to the public. This exposition can be both good and bad, depending on what your repository contains, and if you want to share the content. When you want to share the content, or you can limit the access to www.blabla.com/beta/.hg, you can clone directly from your web server.
Also note that you should not check in any files with passwords or critical secrets, even when you access-limit the repository. It is much more save to check in template files (with a different name than in production), and copy-and-edit these files on the server.

Is version control possible on a shared host w/o shell access?

I have a client who's host doesn't allow shell access. Is there any multi-user revision control system that can work in that situation (on linux)? He's reluctant to switch hosts.
Yes, because you don't do development directly on the production server! The content of your production server is just a view of your source repository, which is kept elsewhere so that work can be done on a separate dev server. This way, a stupid mistake on the dev server won't hose your production system. If that means doing a manual checkout to transfer the files, so be it.
Not the answer you're looking for, but get a better hosting provider. Is there something special your hosting provider is doing for you that makes you want to put up with no shell access, or even not just preinstalling SVN for you? There's a ton of really good hosts for really cheap that will give you SVN already installed, and shell access.
I use Bazaar for exactly this reason. If the server supports ftp or ftps, it supports Bazaar.
http://bazaar.canonical.com/
I've been looking for the same thing, I have a no-shell-access hosting provider with no included source control and don't want to change.
Currently, I'm using git. But instead of using git push to update the remote repository, I use a script and FTP to update the server's copy.
git pull works normally from any client, if the ftp git directory is accessible over http.
git push replacement:
git update-server-info
perl ftpsync.pl -v .git ftp://ftp.example.com/gitrepo/project.git
ftpuser=user#example.com ftppasswd=*
That's using ftpsync, from the Sourceforge ftpsync page. It's an imperfect replacement for git's push, it mirrors the local repo, instead of merging it with the remote, so make sure the local repo is up to date with git pull first.
git-ftp purports to do the same thing. Github's git-ftp page. Probably works better than ftpsync, because it's designed for the purpose, but I haven't tried it.
Sure, SVN can have multiple users and multiple repositories. Depending of course on whether your host is willing to install it. If that doesn't work, maybe you'd consider hosting your version control somewhere else?
Do you mean that you want to store your version control repository on the host and then access it from multiple clients? If yes, then all modern version control systems can work like that.
I just posted this answer on a Mercurial specific question, but it applies here too. I use Mercurial and I found a guide that let me install it with only FTP/control panel access (no shell).
http://javadocs.wordpress.com/2010/04/27/set-up-mercurial-1-5-1-on-a-shared-host-simplified/