Simon Hausmann
9ceab36375
Make it possible to specify the HEAD for the internal findUpstreamBranchPoint function.
...
This isn't used right now in git-p4 but I use it in an external script that loads git-p4 as module.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
09d89de2e3
Added git-p4 branches command that shows the mapping of perforce depot paths to imported git branches.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
1a2edf4e8d
Warn about conflicting p4 branch mappings and use the first one found.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
6555b2ccfe
Fix the branch mapping detection to be independent from the order of the "p4 branches" output.
...
Collect "unknown" source branches separately and register them at the end.
Also added a minor speed up to splitFilesIntoBranches by breaking out of the loop through all branches when it's safe.
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Benjamin Sergeant
da4a660161
git-p4 fails when cloning a p4 depo.
...
A perforce command with all the files in the repo is generated to get
all the file content.
Here is a patch to break it into multiple successive perforce command
who uses 4K of parameter max, and collect the output for later.
It works, but not for big depos, because the whole perforce depo
content is stored in memory in P4Sync.run(), and it looks like mine is
bigger than 2 Gigs, so I had to kill the process.
[Simon: I added the bit about using SC_ARG_MAX, as suggested by Han-Wen]
Signed-off-by: Benjamin Sergeant <bsergean@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
3c699645f5
Fix initial multi-branch import.
...
The list of existing p4 branches in git wasn't initialized.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Marius Storm-Olsen
cbae7080a7
Only use double quotes on Windows
...
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
18 years ago
Simon Hausmann
d7e3868cdf
Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally
...
always rebasing on top of remotes/p4/master
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
27d2d8119b
Moved the code from git-p4 submit to figure out the upstream branch point
...
into a separate helper method.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
e6b711f00e
git-p4 submit: Fix missing quotes around p4 commands to make them work with spaces in filenames
...
Noticed by Alex Riesen
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
a9d1a27af1
Provide some information for single branch imports where the commits go
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Kevin Green
c3bf3f1301
git-p4: check for existence of repo dir before trying to create
...
When using git-p4 in this manner:
git-p4 clone //depot/path/project myproject
If "myproject" already exists as a dir, but not a valid git repo, it fails
to create the directory.
Signed-off-by: Kevin Green <Kevin.Green@morganstanley.com>
18 years ago
Simon Hausmann
6581de096e
Write out the options tag in the log message of imports only if we actually have
...
options
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
a43ff00c7c
Fix support for explicit disabling of syncing with the origin
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
86fda6a327
Fix depot-paths encoding for multi-path imports (don't split up //depot/path/foo)
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
6e5295c4d3
Fix project name guessing
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
cae7b732d8
Fix updating/creating remotes/p4/* heads from origin/p4/*
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
7aded26ce8
Fixed the check to make sure to exclude the HEAD symbolic refs when updating
...
the remotes/p4 branches from origin.
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Han-Wen Nienhuys
5265bfcb06
also strip p4/ from local imports.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
1b9a46849a
print error message when p4 print fails (eg. due to permission problems)
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Simon Hausmann
df450923a2
Only get the expensive branch mapping from the p4 server when not
...
syncing with the help of an origin remote (which we instead then use
to get new branches from).
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
a3fdd57901
Make git-p4 submit detect the correct reference (origin) branch when
...
working with multi-branch imports.
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
5e100b5cd7
Make clone behave like git clone by default again.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Marius Storm-Olsen
c4b33253c2
Exclude the HEAD symbolic ref from the list of known branches
...
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
18 years ago
Marius Storm-Olsen
db775559c2
Fix single branch import into remotes
...
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
18 years ago
Marius Storm-Olsen
98ad4faf95
Fix git-p4 clone (defaultDestination)
...
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
18 years ago
Marius Storm-Olsen
f7baba8b09
Ensure that the commit message is Windows formated (CRLF) before invoking the editor.
...
(The default editor on Windows (Notepad) doesn't handle Unix line endings)
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
18 years ago
Simon Hausmann
a52d5c7bc0
Fix depot-path determination for git-p4 submit
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
b0d10df77a
Fix git-p4 submit
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
68c4215306
Fix git-p4 rebase
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
6509e19cd1
Hack to make the multi-branch import work again with self.depotPaths now that
...
self.depotPath is gone
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
330f53b8d6
Don't attempt to set the initialParent on multi-branch imports (useless).
...
At some point the code paths should be unified, but for now I need a working
git-p4 :)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
583e170706
Fix common path "calculation" from logs of multiple branches.
...
Need to use min instead of max for prev/cur to avoid out-of-bounds
string access. Also treat "i" as index of the last match instead of
a length because in case of a complete match of the two strings
i was off by one.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Simon Hausmann
845b42cb6c
Fix support for "depot-path" in older git-p4 imports
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
18 years ago
Han-Wen Nienhuys
7530a40ce2
look for 'text' and 'binary' files.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
b1ce944726
thinko: really ignore deleted files.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
b17f88b544
remove debug print
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
86dff6b676
Cleanups & import into p4/master for local import
...
- import into master/local if --import-local is set
- use Die() for exiting
- if --verbose is set, raise Exception()
- use joined strings iso. `list` for progress printing
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
d2c6dd30ef
use p4CmdList() to get file contents in Python dicts. This is more robust.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
f2eda79f69
only run p4 print if necessary
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
982bb8a303
don't p4 print deleted files.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
96e07dd23c
read files before creating the commit.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
a3287be5bc
thinko.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
183b8ef89b
store p4 user cache in home directory.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
9320da8dd4
Thinko, fix buglet.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
6a49f8e2e0
Read p4 files in one batch.
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
b86f73782e
remove global .gitdir
...
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Han-Wen Nienhuys
bb6e09b27a
Diverse cleanups
...
- print commands with \n
- extractDepotPathsAndChangeFromGitLog -> extractSettings, returning
dict.
- store keepRepoPath in [git-p4: ] line
- create a main() function, so git-p4 can be pychecked
- use --destination for clone destination. This simplifies logic
for --keep-path
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
18 years ago
Simon Hausmann
cfeb59be25
Fix typo in listExistingP4Branches that broke sync.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago
Simon Hausmann
9226c03c32
In *_pipe print the command that failed if it fails.
...
Fixed old calls to mypopen.
Signed-off-by: Simon Hausmann <simon@lst.de>
18 years ago