How to import perforce .patch in to perforce new Changlist - perforce

I have perforce .patch file generated, wanted to import that file in current ChangeList.
was exploring options but did not find command for.

Related

Merge old swap file with current file in Vim

We have *.swp in our .gitignore to prevent Vim swap files from getting added to the repository.
I recently did a git pull operation, which pulled the latest updates to a file.
I had an old Vim swap file that had some changes that I want to preserve.
Question: How do I diff / merge the Vim swap file with the current version of the file?
You can recover the swap file and then do pull again and merge the recovered file with the new version from your remote.

How to sync to specific folder using command line in Perforce

Suppose I have mapped my depot to client workspace as c:/perforce/project but now
I want to sync all the files present in c:/perforce/project/fold1/fold2 folder.
How can we do it, as the command p4 sync takes only file names and not folder.
Say the depot path is //depot/project/...
From the command line, do p4 sync //depot/project/fold1/fold2/...
(the "..." tells Perforce you want that folder and everything under it).
From P4V, right-click on the folder and choose "Get Latest Revision". It will only pull in the folder and everything underneath it.

how to add files in svnserver using linux

I am creating a svnrepository using svnadmin create svndump
In the svnsump I am creating a folder with the name trunk and importing some of my existing files.
svn import /home/somefiles/ file:///home/svndump/trunk/
But when i see trunk folder it does'nt contains any folder which are imported from somefiles folder.
but when i looked the files using svn log file:///home/svnadump/trunk/ i can see the files .
it seems files are copying but they are not adding to the repository..
how to add files to repository???
Please help me..
Thanks in Advance.
You should be using svn ls to view the contents of repository.
For adding files to repository once you have imported, the standard way is to checkout a copy, add some files using 'svn add' and them commit them to the repository.

How can I delete an unretrievable file from a Perforce repository?

In my Perforce repository there's a file that was submitted a while ago and was at one point valid. I need to move the file and its parent directory to a different location in the repository. However, I'm unable to retrieve a copy of the file from the repository due to the following error reported in P4V (2010.2) and p4 on Linux & Mac OS X:
Bad AppleSingle/Double header.
Malformed FInfo/FXInfo structure! File not updated.
The file is an Apple DMG (disk image) installer. It appears that the file in the repository is corrupted and I'm unable to retrieve it.
Is it possible to retrieve the file regardless of errors in the file in the repository?
Is it possible to move the file in the repository without have a local copy of the file in my workspace?
Use the command line tool:
p4 delete -n //path/to/the/rotten/file
As long as your client maps //path/... you can delete things without fetching them (eg, don't do a p4 sync first)

SVN - How to upload a single file?

How do I upload a single file from my local computer to a SVN repository?
I can import a directory, but I can't import a single file into existing directory.
I use SVN in linux (command line).
Any help would be appreciated.
Edit:
I forgot to mention, I need to upload this file into a specific directory that has nothing to do with directory structure in my local computer (say I upload from Desktop).
So I want to upload a file from Desktop to https://.../somefolder
This can be done as the OP requires.
svn import -m "Adding a new file" file_to_upload.ext http://example.org/path/to/repo/file_to_upload.ext
This allows uploading a file directly into the repository without checking out to a local working directory.
Well, short answer is that it doesn't work like that :)
In SVN you work with a checked-out revision of your repository. In order to "upload a single file" you have to "add" the file with "svn add foo.txt" and then run "svn commit -m "Added file foo" foo.txt". But you can only do this to an existing repository. Therefore you must first checkout the revision (rev of trunk or a given branch) of the repository to add the file to. So the entire steps would be something like
svn co https://svn.internal.foo.com/svn/mycoolgame/branches/1.81
create your new file in the correct place in the folder structure checked out.
svn add your new file
svn ci -m "added file lalalalala" you new file
After this, you can delete your local copy again.
8-year edit: As mentioned svn import can also be used to accomplish this without having a local copy under version control. Do note though that this does so recursively and will add directories not present in the repository. This could be desired behavior or a source of potential errors depending on the situation.
svn add /path/to/your/file.txt
svn ci /path/to/your/file.txt -m "This is where the message goes"
Or if you havn't added anything else just commit with
svn ci -m "Your message"
svn add filename
svn commit filename

Resources