tests/test-import.t
changeset 15522 cf0f3cb8a332
parent 15462 2b1ec74c961f
child 15540 ad2c5561cada
equal deleted inserted replaced
15521:117f9190c1ba 15522:cf0f3cb8a332
   231   > msg = email.Message.Message()
   231   > msg = email.Message.Message()
   232   > patch = open(sys.argv[1], 'rb').read()
   232   > patch = open(sys.argv[1], 'rb').read()
   233   > msg.set_payload('email commit message\n' + patch)
   233   > msg.set_payload('email commit message\n' + patch)
   234   > msg['Subject'] = 'email patch'
   234   > msg['Subject'] = 'email patch'
   235   > msg['From'] = 'email patcher'
   235   > msg['From'] = 'email patcher'
   236   > sys.stdout.write(msg.as_string())
   236   > file(sys.argv[2], 'wb').write(msg.as_string())
   237   > EOF
   237   > EOF
   238 
   238 
   239 
   239 
   240 plain diff in email, subject, message body
   240 plain diff in email, subject, message body
   241 
   241 
   244   adding manifests
   244   adding manifests
   245   adding file changes
   245   adding file changes
   246   added 1 changesets with 2 changes to 2 files
   246   added 1 changesets with 2 changes to 2 files
   247   updating to branch default
   247   updating to branch default
   248   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   248   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   249   $ python mkmsg.py diffed-tip.patch > msg.patch
   249   $ python mkmsg.py diffed-tip.patch msg.patch
   250   $ hg --cwd b import ../msg.patch
   250   $ hg --cwd b import ../msg.patch
   251   applying ../msg.patch
   251   applying ../msg.patch
   252   $ hg --cwd b tip | grep email
   252   $ hg --cwd b tip | grep email
   253   user:        email patcher
   253   user:        email patcher
   254   summary:     email patch
   254   summary:     email patch
   306   adding manifests
   306   adding manifests
   307   adding file changes
   307   adding file changes
   308   added 1 changesets with 2 changes to 2 files
   308   added 1 changesets with 2 changes to 2 files
   309   updating to branch default
   309   updating to branch default
   310   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   310   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   311   $ python mkmsg.py exported-tip.patch | hg --cwd b import -
   311   $ python mkmsg.py exported-tip.patch msg.patch
       
   312   $ cat msg.patch | hg --cwd b import -
   312   applying patch from stdin
   313   applying patch from stdin
   313   $ hg --cwd b tip | grep second
   314   $ hg --cwd b tip | grep second
   314   summary:     second change
   315   summary:     second change
   315   $ rm -r b
   316   $ rm -r b
   316 
   317 
   323   > msg = email.Message.Message()
   324   > msg = email.Message.Message()
   324   > patch = open(sys.argv[1], 'rb').read()
   325   > patch = open(sys.argv[1], 'rb').read()
   325   > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
   326   > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
   326   > msg['Subject'] = '[PATCH] email patch'
   327   > msg['Subject'] = '[PATCH] email patch'
   327   > msg['From'] = 'email patcher'
   328   > msg['From'] = 'email patcher'
   328   > sys.stdout.write(msg.as_string())
   329   > file(sys.argv[2], 'wb').write(msg.as_string())
   329   > EOF
   330   > EOF
   330 
   331 
   331 
   332 
   332 plain diff in email, [PATCH] subject, message body with subject
   333 plain diff in email, [PATCH] subject, message body with subject
   333 
   334 
   336   adding manifests
   337   adding manifests
   337   adding file changes
   338   adding file changes
   338   added 1 changesets with 2 changes to 2 files
   339   added 1 changesets with 2 changes to 2 files
   339   updating to branch default
   340   updating to branch default
   340   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   341   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   341   $ python mkmsg2.py diffed-tip.patch | hg --cwd b import -
   342   $ python mkmsg2.py diffed-tip.patch msg.patch
       
   343   $ cat msg.patch | hg --cwd b import -
   342   applying patch from stdin
   344   applying patch from stdin
   343   $ hg --cwd b tip --template '{desc}\n'
   345   $ hg --cwd b tip --template '{desc}\n'
   344   email patch
   346   email patch
   345   
   347   
   346   next line
   348   next line