On a CentOS Linux machine, I have copied a folder project that has mercurial.
Hg status
in the source folder was clean.
Now hg status in the new folder shows modified files. Those files seem to be quasirandom: 2 php files and most of the image folder from almost a thousand files.
Of course,
hg diff -g
dows not show anything.
I've done this before to create a test instance of the same project, different branch, and everything was ok.
I've read here about modified permissions, but this is not the case. I've looked in the filesystem and all files pairs are 0644 and are identical.
Is there any other file property that is tracked by Mercurial and can be modified by a file copy command?
Edit 1
As it turns out,
hg diff --git
shows permissions modified from 755 to 644, but I'm looking at the files in the original folder and this is not true. All files are 644, but for reasons unknown, Mercurial thinks they are 755
Edit 2
So, the theory is that the old repo is somehow borked: it thinks some files are 755 while in fact they are 644.
To prove the theory I cloned the repo using hg clone and lo and behold, in the new repo all those specific files are cloned as 755.
Checked again the source: 644. Destination: 755
So much for Mercurial reliability
Related
I got all the fonts from the Google font project on my computer via Terminal by using:
hg clone someURL;
I would like to delete it all from my computer. I've seen the following code suggested in another thread:
rm -r .hg
I'm uncertain what the .hg refers to though. There are less than 20 fonts in the 'googlefontdirectory' folder, even though I can use many more Google fonts in various apps. I'm concerned that simply deleting the 'googlefontdirectory' folder won't get rid of everything, since most of the fonts don't seem to be there. What is the best way to delete/remove all fonts that came with the 'hg clone'?
ALL files in repo, cloned by hg clone command placed inside one directory, which is Working Copy and local repository in .hg subdir. rm -r .hg doesn't remove all cloned data, only repository without working copy
hg help clone
...
Create a copy of an existing repository in a new directory.
If no destination directory name is specified, it defaults to the
basename of the source.
Added results of repo-clone
There are less than 20 fonts in the 'googlefontdirectory' folder
Really?!
hg clone https://code.google.com/p/googlefontdirectory/
...
added 3056 changesets with 60182 changes to 46816 files (+1 heads)
updating to branch default
27215 files updated, 0 files merged, 0 files removed, 0 files unresolved
dir /S *.ttf
...
Total Files Listed:
1295 File(s) 201 270 824 bytes
I want to clone my Mercurial repository into my /public_html folder on my web server. My Mercurial project looks like this...
- /ProjectName
- /public
- /application
- /config
- /library
What I want is to just get the contents of "ProjectName" into my /public_html folder. Unfortunately, cloning the repository includes "ProjectName" and all of the subfolders are in there.
Any idea how to accomplish this without a symbolic link?
Just to put it out there, you probably don't want a full clone in your public_html unless you really want every version that ever was out there on the web. There's nothing inherently wrong with that, but since you'll have a .hg in public_html people will even be able to clone your repository from it.
Instead consider using the hg archive command which exports all the files as they exist at a specific revision and places them wherever you want.
For example:
cd your_clone
hg archive --rev release /public_html
That takes the code pointed to by the release label (which could be a tag, bookmark, or branch head) and puts the files, but not a full-history clone, in /public_html.
I actually found an easy way to do this.
hg clone https://me#bitbucket.org/me/ProjectName "/home/website/public_html"
public_html has to be empty to clone the repository into it, so I moved everything out, cloned the repo, then moved the pre-existing files and folder back.
Here is a simple step that you can follow:
cd /public_html
hg init .
hg pull ../pathto/ProjectName/
This will pull all the files and folders under ProjectName in public_html without creating /public_html/ProjectName.
But it will still copy all the resources that are in the mercurial repository (Files and Folders) into your directory.
I created a repository and synchronized it with a remote repository.
The files are compressed and each has an (i) extension.
I want to extract the files to a new folder (not repository) with decompressing them and with their original name as I see them on the web browsing on Google code.
Normally you do hg clone <remoteRepoPath> <localPath> to do that, which automatically updates the working directory.
Since you did an hg init and then hg pull from the remote repo, you need to do hg update and it will fill the working directory with the actual files.
All those .i files under the .hg directory are the repository's storage and indexes and such. Very rarely does anybody mess with those manually. Most of the time the only thing people touch under the .hg directory is the hgrc file and patch queues.
Following is the scenario: I have a remote Mercurial repository at ssh://remotehost//dir/repo and I am able to clone it to a local host "pandora" in directory /home/user/localrepo/.
Now, I have a superset of this remote repository, where I add my own testing framework, but do not want to merge to the main depot until I am certain it works. So I clone this "local" repo to /home/user/workingdir/ but when I issue the command to do so
$ hg clone /home/user/localrepo/
only the repository folder gets copied none of the files get copied.
I'm not sure what you mean when you say that "only the repo folders gets copied". So there's two things you can try :
Try to do a hg update in your new clone.
List the directory in /home/user/workingdir and if there is a directory name localrepo in it, this is actually your repository. To clone in the current directory, you must do hg clone /home/user/localrepo .
This sounds odd but try a few things:
First in the local repo that you cloned from do a
hg status -A
are all the files that you think should be in there in there? If not are you at the tip of the repo.
You can see what revision you are at with
hg parent
If you want to just go to the tip do hg update
If there still aren't any files listed in the repo do the same to check the one on the server.
If there aren't any files on the server you will need to add all of the files you want mercurial to track, mercurial doesn't automagically start tracking files in the repo location.
(Use hg add --all to add all of the file in the entire directory tree under the repo location.)
If there are files in the local repo, check the testing area and make sure that it is on the proper changeset.
For a while I had just my code under source control, but I decided it would be cool to put things like my stuff in my .vim folder among other things in a repo. (I'm obviously not going to store everything in my repo, just various config files, my src directory, and maybe a few other things as well)
I was able to set up a repo fine, then push it to my server where I can access it from my other computers, but I can't clone it to my other computers. When I try to clone it it fails because the home directory isn't empty. Is there a way to do what I want here?
Since the versioned files between my computers are the same, what I did was:
~$ hg clone ssh://myserver/hg/dotfiles mydotfiles
~$ mv mydotfiles/.hg .
~$ rm -rf mydotfiles
and that's it, now your home folder is under version control, but of course if your dot files are not identical between computers you will have to do something about it.
Since I only want to version some files and not everything under my home folder, I have this simple rule in ~/.hgignore
# This .hgignore is for the dotfiles repository only,
# the rest of my HG repositories use the file
# .hgignore_global as referenced by [ui]'s ignore setting.
syntax:glob
*
This way I don't get an ocean of files when I do hg status and only see those files that I have under version control that have been modified.
But since I want to see unversioned files when working within another hg repository, I have this in my ~/.hgrc file
[ui]
ignore=/home/gajon/.hgignore_global
And ~/.hgignore_global contains some filters for common transient files:
syntax: glob
*.pyc
*~
.*.swp
.svn*
*.svn*
*.fasl
syntax: regexp
^\.pc/
Suppose you have proj1 and proj2. proj1 is a mercurial repo you want to clone to proj2, but proj2 already has files in it.
Try this:
hg clone proj1 proj3
mv proj3/.hg proj2
rmdir proj3
cd proj2
hg update -C -r tip
In the other directories that already exist, you could hg init, hg add what you want, hg commit that, hg pull from the central repo, and deal with the resulting merge.